-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
loadbalancer-experimental: consolidate outlier detector concerns into the OutlierDetectorConfig #2864
loadbalancer-experimental: consolidate outlier detector concerns into the OutlierDetectorConfig #2864
Conversation
c393042
to
7a1b5fe
Compare
… the OutlierDetectorConfig Motivation: We currently have two different outlier detector implementations: the xDS compatible implementation and the L4 connection failure implementation. Right now the configuration of them is odd: one is configured on LoadBalancerBuilder and the other is passed to the xDS outlier detector factory. This is a really strange API. Modifications: - move l4 configuration options to OutlierDetectorConfig so everything is in one place - remove the LoadBalancerBuilder.outlierDetector(..) method in favor of one taking the OutlierDetectorConfig - make service-discovery re-subscribing enabled even if consecutive connect failures is not
db8f77c
to
0b9b892
Compare
@@ -30,7 +41,19 @@ | |||
*/ | |||
public final class OutlierDetectorConfig { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is part of the most important change in this PR, specifically it is now the core API used to configure all types of outlier detection.
* @return {@code this}. | ||
* @see #healthCheckFailedConnectionsThreshold(int) | ||
*/ | ||
LoadBalancerBuilder<ResolvedAddress, C> healthCheckInterval(Duration interval, Duration jitter); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The removal of these methods is part of the biggest change in the PR: modification of the API by moving the outlier detector configuration all to OutlierDetectorConfig
.
|
||
// A simple outlier detector implementation that only provides the basic `RequestTracker` implementation | ||
// so the P2C LoadBalancingPolicy can still be effective. | ||
final class NoopOutlierDetector<ResolvedAddress, C extends LoadBalancedConnection> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a premature optimization: We can probably do without this and just use the XdsOutlierDetector with everything disable if we wanted. This does make the testing easier: otherwise a few tests pop because they expect a certain number of timer tasks and the xds detector makes one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it really NoOp then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you mean the timer task then it would be in that situation since none of the detectors will ever signal an outlier. We could special case that if we wanted as well, but at least at the time this felt better. Then it felt meh, thus the self flagging for other opinions.
...dbalancer-experimental/src/main/java/io/servicetalk/loadbalancer/OutlierDetectorFactory.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change LGTM - i like the single config point.
I dont if we discussed again, but wondering if it makes sense to support a concept of OutlierDetector[]
(eg. filters) vs a single view.
@tkountis and I talked offline about this. (Thomas, please correct me if I misrepresent our conclusions). The downside is that it makes this builder less flexible. However, we don't want to encourage people to make their own |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New API LGTM!
Motivation:
We currently have two different outlier detector implementations: the xDS compatible implementation and the L4 connection failure implementation. Right now the configuration of them is odd: one is configured on LoadBalancerBuilder and the other is passed to the xds outlier detector factory. This is a really strange API.
Modifications:
LoadBalancerBuilder.outlierDetector(..)
method in favor of one taking theOutlierDetectorConfig