Skip to content
/ etcd Public
forked from etcd-io/etcd

Commit

Permalink
grpcproxy: fix "grpc.ErrClientConnClosing" handling
Browse files Browse the repository at this point in the history
Fix

```
go test -v -tags cluster_proxy -run TestWatchErrConnClosed
```

with gRPC >= v1.10

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
  • Loading branch information
gyuho committed Jun 15, 2018
1 parent 281f21e commit c555244
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions proxy/grpcproxy/leader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit c555244

Please sign in to comment.