mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 03:30:37 +00:00
cancel context before waiting for waitgroup to avoid deadlock in RPC on error (#5345)
Co-authored-by: Alexey Sharp <alexeysharp@Alexeys-iMac.local>
This commit is contained in:
parent
bbea37a454
commit
9ff5b21a1e
@ -241,8 +241,8 @@ func (h *handler) handleMsg(msg *jsonrpcMessage, stream *jsoniter.Stream) {
|
||||
// call goroutines to shut down.
|
||||
func (h *handler) close(err error, inflightReq *requestOp) {
|
||||
h.cancelAllRequests(err, inflightReq)
|
||||
h.callWG.Wait()
|
||||
h.cancelRoot()
|
||||
h.callWG.Wait()
|
||||
h.cancelServerSubscriptions(err)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user