upstream: fix degraded health check and thread posting#5662
Merged
mattklein123 merged 4 commits intoenvoyproxy:masterfrom Jan 22, 2019
Merged
upstream: fix degraded health check and thread posting#5662mattklein123 merged 4 commits intoenvoyproxy:masterfrom
mattklein123 merged 4 commits intoenvoyproxy:masterfrom
Conversation
Fixes two bugs with degraded health checks: 1) When an active health check succeeded but marked the host as degraded, we'd always set the change_state to ChangePending, which meant we'd not ever invoke the callback when hosts went from healthy -> degraded. 2) Fix typo preventing degraded hosts from being updated on worker threads. Signed-off-by: Snow Pettersen <snowp@squareup.com>
snowp
commented
Jan 19, 2019
| HostVectorConstSharedPtr hosts_copy(new HostVector(host_set->hosts())); | ||
| HostVectorConstSharedPtr healthy_hosts_copy(new HostVector(host_set->healthyHosts())); | ||
| HostVectorConstSharedPtr degraded_hosts_copy(new HostVector(host_set->healthyHosts())); | ||
| HostVectorConstSharedPtr degraded_hosts_copy(new HostVector(host_set->degradedHosts())); |
Contributor
Author
There was a problem hiding this comment.
I couldn't find a good place to add a test for this - any ideas?
Member
There was a problem hiding this comment.
I think you should be able to add a test in cluster_manager_impl_test that does a sequence of updates and then verifies that the thread local host sets have the hosts they should?
mattklein123
requested changes
Jan 21, 2019
Member
mattklein123
left a comment
There was a problem hiding this comment.
Looks good pending test.
/wait
| HostVectorConstSharedPtr hosts_copy(new HostVector(host_set->hosts())); | ||
| HostVectorConstSharedPtr healthy_hosts_copy(new HostVector(host_set->healthyHosts())); | ||
| HostVectorConstSharedPtr degraded_hosts_copy(new HostVector(host_set->healthyHosts())); | ||
| HostVectorConstSharedPtr degraded_hosts_copy(new HostVector(host_set->degradedHosts())); |
Member
There was a problem hiding this comment.
I think you should be able to add a test in cluster_manager_impl_test that does a sequence of updates and then verifies that the thread local host sets have the hosts they should?
Signed-off-by: Snow Pettersen <snowp@squareup.com>
Signed-off-by: Snow Pettersen <snowp@squareup.com>
danzh2010
pushed a commit
to danzh2010/envoy
that referenced
this pull request
Jan 24, 2019
Fixes two bugs with degraded health checks: 1) When an active health check succeeded but marked the host as degraded, we'd always set the change_state to ChangePending, which meant we'd not ever invoke the callback when hosts went from healthy -> degraded. 2) Fix typo preventing degraded hosts from being updated on worker threads. 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
Fixes two bugs with degraded health checks: 1) When an active health check succeeded but marked the host as degraded, we'd always set the change_state to ChangePending, which meant we'd not ever invoke the callback when hosts went from healthy -> degraded. 2) Fix typo preventing degraded hosts from being updated on worker threads. Signed-off-by: Snow Pettersen <snowp@squareup.com> Signed-off-by: Fred Douglas <fredlas@google.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes two bugs related to degraded health checks:
degraded, we'd always set the change_state to ChangePending, which meant
we'd not ever invoke the callback when hosts went from healthy ->
degraded.
threads.
Signed-off-by: Snow Pettersen snowp@squareup.com
Risk Level: Medium
Testing: Updated unit tests
Docs Changes: n/a
Release Notes: n/a
#5063