From 6cf3dae93e138255c93b7995b4a07307b986817f Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Tue, 1 May 2018 16:19:55 -0700 Subject: [PATCH] etcdserver/api/v3rpc: fix race in stream error logging Signed-off-by: Gyuho Lee --- etcdserver/api/v3rpc/watch.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etcdserver/api/v3rpc/watch.go b/etcdserver/api/v3rpc/watch.go index 643d1dab94e..5a1f621cc2d 100644 --- a/etcdserver/api/v3rpc/watch.go +++ b/etcdserver/api/v3rpc/watch.go @@ -159,7 +159,7 @@ func (ws *watchServer) Watch(stream pb.Watch_WatchServer) (err error) { if rerr := sws.recvLoop(); rerr != nil { if isClientCtxErr(stream.Context().Err(), rerr) { if sws.lg != nil { - sws.lg.Debug("failed to receive watch request from gRPC stream", zap.Error(err)) + sws.lg.Debug("failed to receive watch request from gRPC stream", zap.Error(rerr)) } else { plog.Debugf("failed to receive watch request from gRPC stream (%q)", rerr.Error()) }