mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
grpcproxy: fix "grpc.ErrClientConnClosing" handling
Fix ``` go test -v -tags cluster_proxy -run TestWatchErrConnClosed ``` with gRPC >= v1.10 Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
6e521d2f3f
commit
d922069713
@ -20,10 +20,8 @@ import (
|
|||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"github.com/coreos/etcd/clientv3"
|
"github.com/coreos/etcd/clientv3"
|
||||||
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
|
|
||||||
|
|
||||||
"golang.org/x/time/rate"
|
"golang.org/x/time/rate"
|
||||||
"google.golang.org/grpc"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -69,7 +67,7 @@ func (l *leader) recvLoop() {
|
|||||||
}
|
}
|
||||||
if cresp.Err() != nil {
|
if cresp.Err() != nil {
|
||||||
l.loseLeader()
|
l.loseLeader()
|
||||||
if rpctypes.ErrorDesc(cresp.Err()) == grpc.ErrClientConnClosing.Error() {
|
if clientv3.IsConnCanceled(cresp.Err()) {
|
||||||
close(l.disconnc)
|
close(l.disconnc)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user