-
Notifications
You must be signed in to change notification settings - Fork 5.5k
upstream: allow excluding hosts from lb calculations until initial health check #6794
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
Changes from 26 commits
3293441
fd70113
83f454b
f7b142f
8d0b343
75c8a7c
d94e116
821913e
9de4c56
0bc3d03
1cb40f5
a4a4f10
ed4eaa7
d881b27
ce7d5b4
f017af1
5e688e2
6b962fd
8c33216
ab918c3
7950e0b
510a7a9
c89bb7b
8a9153a
820cd35
b69d22e
b79ef40
1a931fb
0207652
5510ac7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -246,6 +246,7 @@ void HealthCheckerImplBase::ActiveHealthCheckSession::handleSuccess(bool degrade | |
| // it to healthy. This makes startup faster with a small reduction in overall reliability | ||
| // depending on the HC settings. | ||
| if (first_check_ || ++num_healthy_ == parent_.healthy_threshold_) { | ||
| host_->healthFlagClear(Host::HealthFlag::PENDING_ACTIVE_HC); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If someone uses active HC, but has EDS send health state as healthy, what is the initial state? I'm wondering if there is a case where we don't hit this? Would it be better to do this up above like you do in the failure case to make it more clear that this is clearing after the first response?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ping on this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the initial state is still going to be unhealthy (since we don't care about the EDS value when we set the FAILED_ACTIVE_HC flag initially), but it might be clearer and less likely to break in the future if I do what you're suggesting so I'll change it |
||
| host_->healthFlagClear(Host::HealthFlag::FAILED_ACTIVE_HC); | ||
| parent_.incHealthy(); | ||
| changed_state = HealthTransition::Changed; | ||
|
|
@@ -307,6 +308,13 @@ HealthTransition HealthCheckerImplBase::ActiveHealthCheckSession::setUnhealthy( | |
| } | ||
| } | ||
|
|
||
| if (host_->healthFlagGet(Host::HealthFlag::PENDING_ACTIVE_HC)) { | ||
| host_->healthFlagClear(Host::HealthFlag::PENDING_ACTIVE_HC); | ||
| // Even though the health value of the host changed, we set this to Changed to that the cluster | ||
| // can update its list of excluded hosts. | ||
| changed_state = HealthTransition::Changed; | ||
|
mattklein123 marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| if ((first_check_ || parent_.always_log_health_check_failures_) && parent_.event_logger_) { | ||
| parent_.event_logger_->logUnhealthy(parent_.healthCheckerType(), host_, type, first_check_); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.