-
Notifications
You must be signed in to change notification settings - Fork 5.1k
health filter: cache degraded health checks #5659
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
Conversation
Updates the health check filter to cache whether the health check returned the degraded label and insert the header when serving a cached value. Signed-off-by: Snow Pettersen <snowp@squareup.com>
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 looks good. Small comment.
/wait
@@ -27,9 +27,12 @@ class HealthCheckCacheManager { | |||
public: | |||
HealthCheckCacheManager(Event::Dispatcher& dispatcher, std::chrono::milliseconds timeout); | |||
|
|||
Http::Code getCachedResponseCode() { return last_response_code_; } | |||
void setCachedResponseCode(Http::Code code) { | |||
std::pair<Http::Code, bool> getCachedResponseCode() { |
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.
nit: Can you rename getCachedResponseCode()
and setCachedResponseCode()
to something more descriptive now that we are doing more stuff? s/Code/Data or something like that?
Signed-off-by: Snow Pettersen <snowp@squareup.com>
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 great. Thanks!
Updates the health check filter to cache whether the health check returned the degraded label and insert the header when serving a cached value. Signed-off-by: Snow Pettersen <snowp@squareup.com> Signed-off-by: Dan Zhang <danzh@google.com>
Updates the health check filter to cache whether the health check returned the degraded label and insert the header when serving a cached value. Signed-off-by: Snow Pettersen <snowp@squareup.com> Signed-off-by: Fred Douglas <fredlas@google.com>
Updates the health check filter to cache whether the health check
returned the degraded label and to insert the degraded header when serving a cached
degraded response.
Without this, each cached response will essentially clear the degraded health check
value, causing the health value of hosts to flap between healthy and degraded.
Signed-off-by: Snow Pettersen snowp@squareup.com
Description:
Risk Level: Medium
Testing: Added UT to verify
Docs Changes: n/a
Release Notes: n/a
#5063