From 28e9ba365a79e2c1d7989c92576eec56f158d734 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 1 Mar 2017 16:46:13 -0800 Subject: [PATCH] grpcproxy: return closing error when stream is canceled from conn close Fixes #6630 --- proxy/grpcproxy/watch.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/proxy/grpcproxy/watch.go b/proxy/grpcproxy/watch.go index a127c3100..42748fd4a 100644 --- a/proxy/grpcproxy/watch.go +++ b/proxy/grpcproxy/watch.go @@ -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) }