Skip to content

Commit

Permalink
grpcproxy: return closing error when stream is canceled from conn close
Browse files Browse the repository at this point in the history
  • Loading branch information
Anthony Romano committed Mar 2, 2017
1 parent d3aebbf commit 28e9ba3
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 28e9ba3

Please sign in to comment.