Skip to content

Commit 57eeb0c

Browse files
committed
fix send on closed channel panic in eventstream
1 parent 2ff0e68 commit 57eeb0c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

pkg/coordinator/clients/consensus/rpc/eventstream/eventstream.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,13 @@ func (stream *Stream) retryRestartStream() {
230230
return
231231
}
232232

233+
stream.closeMutex.Lock()
233234
if stream.isClosed {
235+
stream.closeMutex.Unlock()
234236
return
235237
}
236-
237238
stream.Errors <- err
239+
stream.closeMutex.Unlock()
238240

239241
backoff = 10 * time.Second
240242
}

0 commit comments

Comments
 (0)