You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the Mono.transform, given addOne is not a Mono uses MonoNext to wrap
MonoNext does s.cancel() before actual.onNext(t);
WorkerTask future gets cancelled (due to MonoNext s.cancel), and can get cancelled even before reactor.core.scheduler.WorkerTask#setFuture. If this happens thread is interrupted and processing on that thread (e.g. reading of IO) can be cut short
In my case the thread doing the map() is an HTTP selector thread and the Thread.interrupt() provoked in WorkerTask#setFuture causes the reading of AbstractInterruptibleChannel to be cut short with a ClosedByInterruptException resulting in an empty response body.
The cancel-before-next in MonoNext is necessary but causes a race condition between reactor.core.scheduler.WorkerTask#dispose and sr.setFuture(f) (in reactor.core.scheduler.Schedulers#workerSchedule), where when dispose() is called before setFuture(f) the thread that is still processing the onNext() signal is prematurely interrupted.
The text was updated successfully, but these errors were encountered:
This commit prevents the undesirable interruption of the WorkerTask's
thread when a cancellation happens within the run() method (eg. a
MonoNext is cancelling upon first onNext downstream).
This would previously lead to a race condition between the cancellation
and the setFuture, which would interrupt if called AFTER the dispose.
has-workaround: The particular code snippet can be changed to using Flux.just(f) in the concatMap instead of Mono.just(j), which will avoid the MonoNext and associated cancellation altogether.
This commit prevents the undesirable interruption of the WorkerTask's
thread when a cancellation happens within the run() method (eg. a
MonoNext is cancelling upon first onNext downstream).
This would previously lead to a race condition between the cancellation
and the setFuture, which would interrupt if called AFTER the dispose.
This is a backport of #1108 (commit a0b752a), as tracked in #1111
See: ReactiveX/RxJava#5711
See: ReactiveX/RxJava#5715
In the following scenario:
In my case the thread doing the map() is an HTTP selector thread and the
Thread.interrupt()
provoked inWorkerTask#setFuture
causes the reading ofAbstractInterruptibleChannel
to be cut short with aClosedByInterruptException
resulting in an empty response body.The cancel-before-next in
MonoNext
is necessary but causes a race condition betweenreactor.core.scheduler.WorkerTask#dispose
andsr.setFuture(f)
(inreactor.core.scheduler.Schedulers#workerSchedule
), where whendispose()
is called beforesetFuture(f)
the thread that is still processing theonNext()
signal is prematurely interrupted.The text was updated successfully, but these errors were encountered: