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
Conversation
…MODIFIED status code
core/src/main/java/com/linecorp/armeria/client/endpoint/healthcheck/HttpHealthChecker.java
Outdated
Show resolved
Hide resolved
...ecorp/armeria/client/endpoint/healthcheck/HttpHealthCheckedEndpointGroupLongPollingTest.java
Outdated
Show resolved
Hide resolved
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
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.
Thanks!
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.
I left a bit, but it doesn't matter. :-)
Thanks @imasahiro
core/src/main/java/com/linecorp/armeria/client/endpoint/healthcheck/HttpHealthChecker.java
Show resolved
Hide resolved
Because he doesn't want to apply for whole 3XX range, I think
…On Wed, Aug 21, 2019 at 10:31 AM Ikhun Um ***@***.***> wrote:
***@***.**** approved this pull request.
I left a bit, but it doesn't matter. :-)
Thanks @imasahiro <https://github.com/imasahiro>
------------------------------
In
core/src/main/java/com/linecorp/armeria/client/endpoint/healthcheck/HttpHealthChecker.java
<#2004 (comment)>:
> @@ -108,8 +109,13 @@ private synchronized void check() {
maxLongPollingSeconds = getMaxLongPollingSeconds(res);
break;
default:
- // Do not use long polling on an unexpected status for safety.
- maxLongPollingSeconds = 0;
+ if (res.status() == HttpStatus.NOT_MODIFIED) {
nit: Why don’t you move this into a case statement to keep consistency.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2004?email_source=notifications&email_token=AAN34S2CDFH7OK7MFNBBTR3QFSLF5A5CNFSM4INLECG2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCCFJSCA#pullrequestreview-277518600>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAN34S3HTMTIAFNNVP6MZM3QFSLF5ANCNFSM4INLECGQ>
.
|
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. :-) |
Yes, if we need to handle more case, I would like to add the code (#2004 (comment)) but since |
Thanks, @imasahiro ! |
`HealthCheckedEndpointGroup` must handle 304 Not Modified status code for long-polling health check requests.
`HealthCheckedEndpointGroup` must handle 304 Not Modified status code for long-polling health check requests.
…MODIFIED status code