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:
Gyuho Lee 2018-06-15 07:31:23 -07:00
parent 6e521d2f3f
commit d922069713

View File

@ -20,10 +20,8 @@ import (
"sync"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/etcdserver/api/v3rpc/rpctypes"
"golang.org/x/time/rate"
"google.golang.org/grpc"
)
const (
@ -69,7 +67,7 @@ func (l *leader) recvLoop() {
}
if cresp.Err() != nil {
l.loseLeader()
if rpctypes.ErrorDesc(cresp.Err()) == grpc.ErrClientConnClosing.Error() {
if clientv3.IsConnCanceled(cresp.Err()) {
close(l.disconnc)
return
}