Skip to content
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

Make sure listeners are notified after first health check has resolved. #2074

Merged
merged 2 commits into from Sep 18, 2019

Conversation

anuraaga
Copy link
Collaborator

Currently if all endpoints start out unhealthy, then the initial endpoints future for a health checked endpoint group never completes. The initial endpoints future should indicate when the endpoints have first been checked, not when they first become healthy - while an EndpointGroup with no Endpoints is sort of useless, I think it's still a perfectly good EndpointGroup and deserves notifying listeners :)

/cc @adriancole

@@ -106,7 +113,7 @@ protected final void setEndpoints(Iterable<Endpoint> endpoints) {
}

private void completeInitialEndpointsFuture(List<Endpoint> endpoints) {
if (!endpoints.isEmpty() && !initialEndpointsFuture.isDone()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah gotiti

@codecov
Copy link

codecov bot commented Sep 13, 2019

Codecov Report

Merging #2074 into master will decrease coverage by 0.13%.
The diff coverage is 90%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2074      +/-   ##
============================================
- Coverage      73.8%   73.66%   -0.14%     
+ Complexity     9392     9373      -19     
============================================
  Files           817      817              
  Lines         36121    36125       +4     
  Branches       4452     4452              
============================================
- Hits          26658    26611      -47     
- Misses         7155     7211      +56     
+ Partials       2308     2303       -5
Impacted Files Coverage Δ Complexity Δ
...dpoint/healthcheck/HealthCheckedEndpointGroup.java 78.43% <100%> (+0.43%) 14 <1> (+1) ⬆️
.../armeria/client/endpoint/DynamicEndpointGroup.java 92.1% <75%> (-7.9%) 14 <3> (ø)
...rp/armeria/server/tomcat/ManagedTomcatService.java 50.84% <0%> (-22.04%) 6% <0%> (-1%)
...armeria/server/tomcat/Tomcat90ProtocolHandler.java 48.14% <0%> (-14.82%) 11% <0%> (-4%)
...om/linecorp/armeria/client/HttpSessionHandler.java 61.01% <0%> (-11.02%) 29% <0%> (-4%)
.../linecorp/armeria/internal/Http2ObjectEncoder.java 71.42% <0%> (-8.58%) 12% <0%> (-1%)
...meria/internal/AbstractHttp2ConnectionHandler.java 93.33% <0%> (-3.34%) 13% <0%> (-1%)
.../linecorp/armeria/server/tomcat/TomcatService.java 63.82% <0%> (-2.66%) 24% <0%> (-1%)
...a/com/linecorp/armeria/common/util/Exceptions.java 36.52% <0%> (-2.61%) 23% <0%> (-2%)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bf869a2...0c1adca. Read the comment docs.

Copy link
Member

@minwoox minwoox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@ikhoon ikhoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@trustin trustin merged commit 23fcc5c into line:master Sep 18, 2019
@trustin
Copy link
Member

trustin commented Sep 18, 2019

Thanks, @ikhoon !

@trustin
Copy link
Member

trustin commented Sep 18, 2019

Oops. Thanks, @anuraaga !

eugene70 pushed a commit to eugene70/armeria that referenced this pull request Oct 16, 2019
…d. (line#2074)

Currently if all endpoints start out unhealthy, then the initial endpoints future for a health checked endpoint group never completes. The initial endpoints future should indicate when the endpoints have first been checked, not when they first become healthy - while an `EndpointGroup` with no `Endpoint`s is sort of useless, I think it's still a perfectly good `EndpointGroup` and deserves notifying listeners :)
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
…d. (line#2074)

Currently if all endpoints start out unhealthy, then the initial endpoints future for a health checked endpoint group never completes. The initial endpoints future should indicate when the endpoints have first been checked, not when they first become healthy - while an `EndpointGroup` with no `Endpoint`s is sort of useless, I think it's still a perfectly good `EndpointGroup` and deserves notifying listeners :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants