New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ManagedArrayBlockingQueue is paused indefinitely having not empty itemQueue #1807
Comments
Update: Suddenly got the exception
|
Seeing the same thing and debugging it. @kwark could you perhaps recall why |
There problem is here:
For all connections taken from the Then how is it possible that this is not the case? One source could be this code in
|
And other hyphothesis is that the priority of a |
I was wrong. This happens because not all task go through the queue. When there are less threads in the ThreadPoolExecutor, it creates a Worker thread to run a given Runnable and that bypasses the queue. So if there are more threads than there are connections in the pool, then the requirement will fail. |
Or actually worse. It could fail in all cases when you have some executions holding the connections (inUseCount has been incremented) and running on application threads (i.e. not doing blocking I/O, but still holding the connection because of tx, etc). Then if a new Runnable is sent to the asyncExecutor it can create a new thread to run it, bypassing the queue, and shit hits the fan. Having now been reading the code, I think it is extremely bad fragile and should be completely replaced. It is a big mud ball that should have never seen a commit. |
@hvesalai Previously I thought that every submitted In my project with controllable workload I eventually switched from |
The only way to prevent this issue when using |
I'm investigating a rare problem that manifests itself as:
3.2.1
stopped processingDBIOAction
s from theManagedArrayBlockingQueue
that becamepaused
having not emptyitemQueue
. Async executor threads are waiting onnotEmpty
lock:2.5.1
closed all connections due to idle connection timeoutInside a heap dump of the application I found the following state of
ManagedArrayBlockingQueue
instance:and it's
itemQueue
state:I'm wondering if I stumbled upon a concurrency issue in slick (like in #1730)? And could I replace a
ManagedArrayBlockingQueue
with aLinkedBlockingQueue
to workaround the possible concurrency issue withManagedArrayBlockingQueue
?Thanks!
The text was updated successfully, but these errors were encountered: