Skip to content

Commit

Permalink
Fix client RPC stream close mutex (micro#1643)
Browse files Browse the repository at this point in the history
  • Loading branch information
veger committed May 18, 2020
1 parent 56a7897 commit 3d36398
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/rpc_stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 3d36398

Please sign in to comment.