-
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
grpc: report connectivity state changes on the ClientConn for Subscribers #6437
Conversation
@easwars : Thank you for reviewing! I've fixed some implementations according to your comments. |
Co-authored-by: Easwar Swaminathan <easwars@google.com>
@dfawley for second set of eyes. |
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) | ||
defer cancel() | ||
r.UpdateState(resolver.State{Addresses: []resolver.Address{{Addr: backend.Address}}}) | ||
awaitState(ctx, t, cc, connectivity.Ready) |
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.
This looks like it will be flaky to me, just like the previous instance of the same thing we found.
However, idleness is a great test of the pubsub delivering transitions reliably that the other API could miss. So I think we can just delete this awaitState
and everything will be good.
if gotState != wantState { | ||
t.Errorf("Received unexpected state: %q; want: %q", gotState, wantState) | ||
} | ||
case <-time.After(defaultTestTimeout): |
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.
Nit: initialize the context at the start of the test and use <-ctx.Done()
here instead.
if t.Failed() { | ||
t.FailNow() | ||
} |
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.
IIUC this can be deleted since there is no code after it.
Thanks @dfawley ! |
This PR adds a logic to report connectivity state changes on the ClientConn for Subscribers.
Please refer to #6036 (comment) in #6036 . Original issue is #5818.
RELEASE NOTES: none