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
implicitvalscheduler:Scheduler=Scheduler.forkJoin(4, 8)
// make the pool reach its maximum thread countTask.parTraverseUnordered(0 until 1000) { _ =>Task(scala.concurrent.blocking(Thread.sleep(10)))
}.runSyncUnsafe()
println("slept")
// this task never executesTask(println("foo")).executeAsync.runSyncUnsafe()
println("done")
After the pool reaches its maximum size caused by blocking operations, it does not execute any tasks even despite the fact that blocking operations have already finished and threads are idle.
The culprit seems to be monix.execution.internal.forkJoin.DynamicWorkerThreadFactory - the code above works fine if the Scheduler is defined like this:
OK, now I understand why this was done the way it was - ForkJoinPool changed between JDK8 and JDK11 (it didn't have maxThreads parameter in JDK8). Unfortunately, JDK8 is also prone to this bug so I'm not sure what would a JDK-independent fix look like.
Try running this code:
After the pool reaches its maximum size caused by blocking operations, it does not execute any tasks even despite the fact that blocking operations have already finished and threads are idle.
The culprit seems to be
monix.execution.internal.forkJoin.DynamicWorkerThreadFactory
- the code above works fine if the Scheduler is defined like this:Environment: Monix 3.4.1, Scala 2.13.8, JDK 11
The text was updated successfully, but these errors were encountered: