-
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
xds/ringhash: update connectivity state aggregation, and make sure at least one SubConn is connecting in TF #5338
Conversation
…ggregation, and make sure on SubConn is connecting in TF
@@ -147,8 +156,10 @@ func (sc *subConn) effectiveState() connectivity.State { | |||
// it's Connect() will be triggered. If the SubConn state is already Idle, it | |||
// will just call Connect(). | |||
func (sc *subConn) queueConnect() { | |||
fmt.Printf(" ===== queue connect for %v\n", sc) |
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.
Delete (there are at least a few of these in here)
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
@@ -417,6 +463,12 @@ func (cse *connectivityStateEvaluator) recordTransition(oldState, newState conne | |||
updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. | |||
cse.nums[state] += updateVal | |||
} | |||
if oldState == connectivity.Shutdown { |
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.
Can you ever transition from shutdown?
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.
When a new SubConn is created, we record a shutdown->idle transition.
(And I believe we do the same in roundrobin)
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.
Ah yes, that makes sense thanks.
@@ -417,6 +463,12 @@ func (cse *connectivityStateEvaluator) recordTransition(oldState, newState conne | |||
updateVal := 2*uint64(idx) - 1 // -1 for oldState and +1 for new. | |||
cse.nums[state] += updateVal | |||
} | |||
if oldState == connectivity.Shutdown { |
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.
Ah yes, that makes sense thanks.
grpc/proposal#296
RELEASE NOTES: N/A