Skip to content

Commit 8065699

Browse files
authored
Fixed processor dispose race condition (#135)
1 parent 6a82fb1 commit 8065699

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

internal/socket/duplex.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,13 @@ func (dc *DuplexConnection) RequestResponse(req payload.Payload) (res mono.Mono)
256256

257257
onFinally := func(s reactor.SignalType, d reactor.Disposable) {
258258
common.TryRelease(handler.cache)
259-
d.Dispose()
260259
if s == reactor.SignalTypeCancel {
261260
dc.sendFrame(framing.NewWriteableCancelFrame(sid))
262261
}
262+
// Unregister handler w/sink (processor).
263263
dc.unregister(sid)
264+
// Dispose sink (processor).
265+
d.Dispose()
264266
}
265267

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

0 commit comments

Comments
 (0)