-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
pickfirst: Register a health listener when used as a leaf policy #7832
Merged
Merged
Changes from 9 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a1517c7
Register a health listener in the new pickfirst balancer
arjan-bal 53e7de9
Address review comments
arjan-bal a68c372
Fix typo
arjan-bal cf153cb
Address review comments
arjan-bal 13ad224
Add test for verifying listener is not registered when not enabled
arjan-bal ce4d36f
Move sticky TF into subchannel state
arjan-bal be9ca5c
Address review comments
arjan-bal c109eb4
Merge remote-tracking branch 'source/master' into pickfirst-health-li…
arjan-bal d852260
Rename effective state variable
arjan-bal 9d86f5e
Address review comments
arjan-bal 886ad2f
Address review comment
arjan-bal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
If
oldState
isReady
, doesn'tnewState
have to beIdle
?And if
newState
isIdle
, the previous state must have beenReady
, right? We may have not gotten the update (because of the Connecting->Ready->Idle race), but....can this whole thing be replaced by justif newState.ConnectivityState == connectivity.Idle
?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.
Yes, this is true because the health state is not sent via the connectivity listener anymore. So READY->TF->READY transitions are not possible and no duplicate READY updates are sent by addrConn.
This is false as a transition from TF->IDLE is possible after the subchannel completes its backoff.
We can simplify the condition to
oldState != TF && newState == IDLE
, along with a comment explaining the assumptions that lead to this simplification. IMO, this may make it harder to understand. Do you think I should make the change?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.
As discussed offline, please change to look like we want it to look (if we didn't have the bug) and add a clause that covers the bug:
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.
(and add a TODO to remove the second half when the bug is fixed please)
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.
Done.