-
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: perform a blocking close of the balancer in ccb #6497
Conversation
Can you clarify this? Is this the new policy or the old policy? |
// Verify that the ClientConn moves to READY. | ||
ctx, cancel := context.WithTimeout(context.Background(), defaultTestTimeout) | ||
defer cancel() | ||
awaitState(ctx, t, cc, connectivity.Ready) | ||
client := testgrpc.NewTestServiceClient(cc) | ||
if _, err := client.EmptyCall(ctx, &testpb.Empty{}); err != nil { | ||
t.Errorf("EmptyCall RPC failed: %v", err) | ||
} |
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.
Why not just delete this entirely? We're going to perform 20 RPCs after this anyway.
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 acts as a sanity check to ensure that the channel is READY
and can make RPCs before we get to our actual test. So, if for some reason, the channel doesn't become READY
, then we will fail here and will have a better signal instead of failing down below wherein we might initially think the failure is because of a bad interaction between idle timeout firing and a new RPC being made.
It is the old policy. Updated the PR description. |
This PR fixes the following issue:
READY
and things are goodIDLE
IDLE
and a new LB policy is createdREADY
TRANSIENT_FAILURE
This whole scenario can be prevented if the old policy was shutdown inline when the channel entered
IDLE
.This PR also includes a minor fix to one of the tests to prevent a race where the test is waiting for the channel become
READY
. But it could so happen that the channel becameREADY
and in fact becameIDLE
before the test started the check. Instead of relying on the connectivity state, the test now performs an RPC to ensure that the channel is in factREADY
.RELEASE NOTES:
TRANSIENT_FAILURE
when actually moving toIDLE