Holder.checkout deadlock?
tim2CF opened this issue · comments
I’m trying to test some cluster features of my app with ex_unit_clustered_case
package. Local cluster starts successfully, but when I’m trying to call some Ecto Repo functions in slave node, Repo always returns error
%DBConnection.ConnectionError{
message: "connection not available and request was dropped from queue after 1333ms. You can configure how long requests wait in the queue using :queue_target and :queue_interval. See DBConnection.start_link/2 for more information"
}
I started to investigate what is happening on cluster nodes at this moment using observer tool and found interesting processes on top:
Can it be some deadlock in this receive
expression?
db_connection/lib/db_connection/holder.ex
Line 237 in 9d2416a
Maybe you have an idea how to fix it?
What is your DBConnection version? In any case, without an isolated mechanism to consistently reproduce the issue I am afraid there isn't much we can do.
version 2.1.0
Looking at the screen you pasted, I sort of wonder what is that message stuck in the queue. You should be able to see it with observer.
unfortunately looks like these processes are instantly restarting and query queue stuck
https://ibb.co/rkzNFQw
It was too low max_connections
parameter from postgres side...
Happened because I reinstalled postgres recently. I just was expecting different more obvious error message for this case 😀