-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
clientv3: wait for ConnectNotify before sending RPCs #8601
Conversation
4b725dd
to
09a43e5
Compare
Health balancer in #8545 adds a method
This happens because |
clientv3/integration/kv_test.go
Outdated
@@ -442,7 +442,7 @@ func TestKVGetErrConnClosed(t *testing.T) { | |||
go func() { | |||
defer close(donec) | |||
_, err := cli.Get(context.TODO(), "foo") | |||
if err != nil && err != grpc.ErrClientConnClosing { | |||
if err != nil && err != context.DeadlineExceeded && err != grpc.ErrClientConnClosing { | |||
t.Fatalf("expected %v, got %v", grpc.ErrClientConnClosing, 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.
this needs to be similar to line 795?
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.
also this seems wrong. the user does not pass in deadline (context.TODO()). so why deadlineExceeded will be returned? is dialing deadline exceeded in this case or what?
clientv3/integration/kv_test.go
Outdated
@@ -791,8 +791,8 @@ func TestKVGetStoppedServerAndClose(t *testing.T) { | |||
// this Get fails and triggers an asynchronous connection retry | |||
_, err := cli.Get(ctx, "abc") | |||
cancel() | |||
if !strings.Contains(err.Error(), "context deadline") { | |||
t.Fatal(err) | |||
if err != nil && err != context.DeadlineExceeded && err != grpc.ErrClientConnClosing { |
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.
we should return deadline exceed in this case.
i feel we should not mix deadline exceed and clientclosing error together. |
clientv3/retry.go
Outdated
select { | ||
case <-c.balancer.ConnectNotify(): | ||
case <-rpcCtx.Done(): | ||
return grpc.ErrClientConnClosing |
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.
we should just return rpcCtx.Error() here, no?
clientv3/retry.go
Outdated
case <-rpcCtx.Done(): | ||
return grpc.ErrClientConnClosing | ||
case <-c.ctx.Done(): | ||
return grpc.ErrClientConnClosing |
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.
same here
3ec5fac
to
2619d7f
Compare
@xiang90 PTAL. Context errors and client closing errors are mixed only for grpc-proxy tests. |
With slow CPU, gRPC can lag behind with RPCs being sent before calling 'Up', returning 'no address available' on the first try. Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
lgtm |
Codecov Report
@@ Coverage Diff @@
## master #8601 +/- ##
=========================================
Coverage ? 75.81%
=========================================
Files ? 358
Lines ? 29368
Branches ? 0
=========================================
Hits ? 22265
Misses ? 5546
Partials ? 1557
Continue to review full report at Codecov.
|
With slow CPU, gRPC can lag behind with RPCs being sent before
calling 'Up', returning 'no address available' on the first try.
Fix #8581 and many other test failures since #8545.
Full explanation coming...