From 3d36398818f4f9f646b2e2f0268eec27922a1ccb Mon Sep 17 00:00:00 2001 From: Maarten Bezemer Date: Mon, 18 May 2020 18:22:33 +0200 Subject: [PATCH] Fix client RPC stream close mutex (#1643) --- client/rpc_stream.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/rpc_stream.go b/client/rpc_stream.go index 7c880d88..426aafc4 100644 --- a/client/rpc_stream.go +++ b/client/rpc_stream.go @@ -130,15 +130,15 @@ func (r *rpcStream) Error() error { } func (r *rpcStream) Close() error { - r.RLock() + r.Lock() select { case <-r.closed: - r.RUnlock() + r.Unlock() return nil default: close(r.closed) - r.RUnlock() + r.Unlock() // send the end of stream message if r.sendEOS {