EmitterProcessor: cyclical LockSupport.parkNanos(10) gives CPU load 100% #2049
Labels
help wanted
We need contributions on this
status/need-investigation
This needs more in-depth investigation
type/bug
A general bug
Milestone
EmitterProcessor has next code inside onNext(), line 266:
In some cases, flow statement "while" executes forever and it gives very high CPU usage, almost 100%, because LockSupport.parkNanos(10) executes without stop until some subscriber will be attached, all incoming threads stay inside "while" who invoked onNext, because queue is full and there is no drain until new subscriber is attached. If you look inside method "drain", you will see that queue.poll is executed when at least one subscriber is attached only.
Possible Solution
Not so sure about solution, but it can be partial draining if queue is full
Your Environment
javar -version
): 11.0.6uname -a
): win10pro 1909The text was updated successfully, but these errors were encountered: