Skip to content

health filter: cache degraded health checks#5659

Merged
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
snowp:degraded-hc-cache
Jan 22, 2019
Merged

health filter: cache degraded health checks#5659
mattklein123 merged 3 commits intoenvoyproxy:masterfrom
snowp:degraded-hc-cache

Conversation

@snowp
Copy link
Copy Markdown
Contributor

@snowp snowp commented Jan 18, 2019

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

Snow Pettersen added 2 commits January 18, 2019 16:25
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: Snow Pettersen <snowp@squareup.com>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a 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


Http::Code getCachedResponseCode() { return last_response_code_; }
void setCachedResponseCode(Http::Code code) {
std::pair<Http::Code, bool> getCachedResponseCode() {
Copy link
Copy Markdown
Member

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>
Copy link
Copy Markdown
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Looks great. Thanks!

@mattklein123 mattklein123 merged commit cff3844 into envoyproxy:master Jan 22, 2019
danzh2010 pushed a commit to danzh2010/envoy that referenced this pull request Jan 24, 2019
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>
fredlas pushed a commit to fredlas/envoy that referenced this pull request Mar 5, 2019
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants