-
Notifications
You must be signed in to change notification settings - Fork 969
[ISSUE-5705] Support for degraded health #5741
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
base: main
Are you sure you want to change the base?
[ISSUE-5705] Support for degraded health #5741
Conversation
f20ed57 to
665ec13
Compare
trustin
left a comment
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, @seonWKim! 🙇
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckService.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckServiceBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthStatus.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/SettableHealthStatusChecker.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckServiceBuilder.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckService.java
Show resolved
Hide resolved
52fdd7b to
aed0a93
Compare
jrhee17
left a comment
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.
Looks good overall 👍 I think some client-side changes will be needed, but I prefer I do this to ensure compatibility with xDS-side requirements. Left some minor comments 🙇
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthStatus.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckService.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckService.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckServiceBuilder.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckServiceBuilder.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckService.java
Outdated
Show resolved
Hide resolved
trustin
left a comment
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.
Almost there!
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthStatus.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthStatus.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/DefaultHealthCheckUpdateHandler.java
Outdated
Show resolved
Hide resolved
…bleHealthChecker`
Co-authored-by: jrhee17 <[email protected]>
…cify HealthStatus
- Add javadoc on `HealthStatus` - Checks for IF-NONE-MATCH header for specific `HealthStatus` - Add `HealthStatusUpdateHandler`
jrhee17
left a comment
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.
Left some more nit comments 👍
core/src/main/java/com/linecorp/armeria/server/healthcheck/DefaultHealthCheckUpdateHandler.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckServiceBuilder.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthCheckUpdateListener.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/HealthChecker.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/SettableHealthChecker.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/SettableHealthChecker.java
Show resolved
Hide resolved
core/src/main/java/com/linecorp/armeria/server/healthcheck/ScheduledHealthChecker.java
Outdated
Show resolved
Hide resolved
- Add @UnstableApi
a13308f to
74f702d
Compare
74f702d to
2f610ee
Compare
jrhee17
left a comment
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.
👍 👍 👍
| /** | ||
| * Tells {@link HealthCheckService} to mark the {@link Server} as 'under maintenance'. | ||
| */ | ||
| UNDER_MAINTENANCE, |
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.
Can we just use MAINTENANCE?
minwoox
left a comment
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.
Hi, @seonWKim!
Sorry about the late review.
I've pushed some fixes and left some comments to discuss. 😉
| /** | ||
| * The {@link Server} is under maintenance and unable to serve requests. | ||
| */ | ||
| UNDER_MAINTENANCE(100, false); |
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.
Better to put UNDER_MAINTENANCE after STOPPING? We also need to update the Javadoc of priority to explain the value means.
| this.pendingResponses.stream() | ||
| .filter(res -> { | ||
| if (res.pollHealthStatus) { | ||
| return res.interestedStatus != healthStatus; |
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.
Shouldn't it filter when
- the
healthStatusis changed from its previoushealthStatus res.interestedStatus == healthStatus;
|
Hi, @minwoox :) Thanks for the review. I'll take a look |
Motivation:
Add support for degraded health.
Modifications:
HealthStatusenum which can represent the health status of a serverhealthStatus()method inHealthCheckerfor fine-grained representation of server's statusdegradedResponsewhich shows that the server's status is being degraded.I think adding new health check service which returns
HealthStatus(instead of boolean) might be an alternate option. But because this PR is before any reviews, I've just implemented feature on top ofHealthCheckService.Result:
Users can now receive notification for degraded server status like below
{"healthy":true, "degraded":true}degradedserver status in addtion to healthy and unhealthy.