Skip to content

Commit

Permalink
Merge pull request etcd-io#7402 from heyitsanthony/fix-watchconnerr
Browse files Browse the repository at this point in the history
grpcproxy: return closing error when stream is canceled from conn close
  • Loading branch information
Anthony Romano authored Mar 2, 2017
2 parents 134d1cb + 28e9ba3 commit 2eb8243
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion proxy/grpcproxy/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@ func (wp *watchProxy) Watch(stream pb.Watch_WatchServer) (err error) {
select {
case <-wp.ctx.Done():
wp.mu.Unlock()
return
select {
case <-wp.leader.disconnectNotify():
return grpc.ErrClientConnClosing
default:
return wp.ctx.Err()
}
default:
wp.wg.Add(1)
}
Expand Down

0 comments on commit 2eb8243

Please sign in to comment.