Skip to content

Commit

Permalink
Fixed processor dispose race condition (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
echistyakov authored Dec 26, 2024
1 parent 6a82fb1 commit 8065699
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/socket/duplex.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,13 @@ func (dc *DuplexConnection) RequestResponse(req payload.Payload) (res mono.Mono)

onFinally := func(s reactor.SignalType, d reactor.Disposable) {
common.TryRelease(handler.cache)
d.Dispose()
if s == reactor.SignalTypeCancel {
dc.sendFrame(framing.NewWriteableCancelFrame(sid))
}
// Unregister handler w/sink (processor).
dc.unregister(sid)
// Dispose sink (processor).
d.Dispose()
}

m, s, _ := mono.NewProcessor(dc.reqSche, onFinally)
Expand Down

0 comments on commit 8065699

Please sign in to comment.