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
When using windowTimeout(maxElements, duration) in combination with concat/concatWith with the following preconditions:
the number of concatenated elements is greater than maxElements,
duration is small and the following operation rather slow.
Then, the following exception is thrown (and not all concatenated elements are processed):
11:09:26.874 [parallel-1] DEBUG reactor.core.publisher.Operators - onNextDropped: UnicastProcessor
11:09:26.879 [parallel-1] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$ReactorRejectedExecutionException: Scheduler unavailable
at reactor.core.Exceptions.failWithRejected(Exceptions.java:249)
at reactor.core.publisher.Operators.onRejectedExecution(Operators.java:807)
at reactor.core.publisher.FluxWindowTimeout$WindowTimeoutSubscriber.newPeriod(FluxWindowTimeout.java:188)
at reactor.core.publisher.FluxWindowTimeout$WindowTimeoutSubscriber.drainLoop(FluxWindowTimeout.java:385)
at reactor.core.publisher.FluxWindowTimeout$WindowTimeoutSubscriber$ConsumerIndexHolder.run(FluxWindowTimeout.java:440)
at reactor.core.scheduler.PeriodicWorkerTask.call(PeriodicWorkerTask.java:59)
at reactor.core.scheduler.PeriodicWorkerTask.run(PeriodicWorkerTask.java:73)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.util.concurrent.RejectedExecutionException: Scheduler unavailable
at reactor.core.Exceptions.<clinit>(Exceptions.java:502)
at reactor.core.scheduler.Schedulers.workerSchedulePeriodically(Schedulers.java:959)
at reactor.core.scheduler.ExecutorServiceWorker.schedulePeriodically(ExecutorServiceWorker.java:56)
at reactor.core.publisher.FluxWindowTimeout$WindowTimeoutSubscriber.newPeriod(FluxWindowTimeout.java:184)
... 10 common frames omitted
Steps to Reproduce
This seems to be a time-dependent problem. Thus, it does not occur every time. On my machine, it occurred in 9 out of 10 case in this simplified example.
This commit adds a variant of windowTimeout that tries
to honor backpressure of a slow downstream Subscriber
better than the current implementation (which just errors
in the face of backpressure and timeouts).
The operator tries to request the minimum possible amount
from upstream to honor the maxSize, but if a timeout occurs
before all these elements could arrive - and if no more window
is requested from downstream, the elements get temporarily
stored into a pending window that is opened on timeout, until
1 more window is requested.
See also #1898 and #2920.
Fixes#1099.
When using
windowTimeout(maxElements, duration)
in combination withconcat
/concatWith
with the following preconditions:maxElements
,duration
is small and the following operation rather slow.Then, the following exception is thrown (and not all concatenated elements are processed):
Steps to Reproduce
This seems to be a time-dependent problem. Thus, it does not occur every time. On my machine, it occurred in 9 out of 10 case in this simplified example.
Possible Solution
For now, I use bufferTimeout instead. This is not ideal as buffering is not necessary but it works reliably.
Your Environment
netty
, ...):javar -version
): OpenJDK 11.0.1uname -a
): macOS 10.14.6The text was updated successfully, but these errors were encountered: