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

Keep an endpoint's healthiness if long-poll health check returns NOT_… #2004

Merged
merged 2 commits into from Aug 21, 2019

Conversation

imasahiro
Copy link
Member

…MODIFIED status code

@codecov
Copy link

codecov bot commented Aug 20, 2019

Codecov Report

Merging #2004 into master will increase coverage by 0.05%.
The diff coverage is 50%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2004      +/-   ##
============================================
+ Coverage     73.41%   73.47%   +0.05%     
- Complexity     9213     9222       +9     
============================================
  Files           810      810              
  Lines         35853    35856       +3     
  Branches       4404     4405       +1     
============================================
+ Hits          26322    26345      +23     
+ Misses         7258     7233      -25     
- Partials       2273     2278       +5
Impacted Files Coverage Δ Complexity Δ
...client/endpoint/healthcheck/HttpHealthChecker.java 85.29% <50%> (+0.67%) 18 <0> (+1) ⬆️
...lient/circuitbreaker/CircuitBreakerHttpClient.java 69.69% <0%> (-3.04%) 10% <0%> (-1%)
.../linecorp/armeria/internal/Http2GoAwayHandler.java 53.84% <0%> (-2.57%) 13% <0%> (-1%)
...rp/armeria/common/stream/DefaultStreamMessage.java 90% <0%> (-1.43%) 54% <0%> (-1%)
.../main/java/com/linecorp/armeria/server/Server.java 81.58% <0%> (-1.26%) 26% <0%> (ø)
...inecorp/armeria/server/grpc/ArmeriaServerCall.java 87% <0%> (-1.19%) 82% <0%> (ø)
...a/common/grpc/protocol/ArmeriaMessageDeframer.java 71.77% <0%> (+0.95%) 48% <0%> (+1%) ⬆️
.../linecorp/armeria/server/tomcat/TomcatService.java 65.95% <0%> (+2.65%) 23% <0%> (+1%) ⬆️
.../armeria/client/endpoint/dns/DnsEndpointGroup.java 86.31% <0%> (+3.15%) 15% <0%> (+2%) ⬆️
... and 3 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 169f509...f50338d. Read the comment docs.

@trustin trustin added the defect label Aug 21, 2019
@trustin trustin added this to the 0.90.3 milestone Aug 21, 2019
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.

Thanks!

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.

I left a bit, but it doesn't matter. :-)
Thanks @imasahiro

@mauhiz
Copy link
Contributor

mauhiz commented Aug 21, 2019 via email

@minwoox
Copy link
Member

minwoox commented Aug 21, 2019

Perhaps @ikhoon wants it like:

switch (res.status().codeClass()) {
    case SUCCESS:
        maxLongPollingSeconds = getMaxLongPollingSeconds(res);
        isHealthy = true;
        break;
	case REDIRECTION:
		if (res.status() == HttpStatus.NOT_MODIFIED) {
            maxLongPollingSeconds = getMaxLongPollingSeconds(res);
            isHealthy = wasHealthy;
        } else {
            // Do not use long polling on an unexpected status for safety.
            maxLongPollingSeconds = 0;
        }
    case SERVER_ERROR:
        maxLongPollingSeconds = getMaxLongPollingSeconds(res);
        break;
    default:
        // Do not use long polling on an unexpected status for safety.
        maxLongPollingSeconds = 0;
}

But I like the current way. :-)

@imasahiro
Copy link
Member Author

Yes, if we need to handle more case, I would like to add the code (#2004 (comment)) but since 304 is the only special case we need to care at the moment, I would like to merge into default case.

@trustin trustin merged commit 708cde4 into line:master Aug 21, 2019
@trustin
Copy link
Member

trustin commented Aug 21, 2019

Thanks, @imasahiro !

@imasahiro imasahiro deleted the lp branch August 21, 2019 05:45
trustin pushed a commit that referenced this pull request Aug 21, 2019
`HealthCheckedEndpointGroup` must handle 304 Not Modified status code
for long-polling health check requests.
fmguerreiro pushed a commit to fmguerreiro/armeria that referenced this pull request Sep 19, 2020
`HealthCheckedEndpointGroup` must handle 304 Not Modified status code
for long-polling health check requests.
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