elixir-ecto / db_connection

Database connection behaviour

Home Page:http://hexdocs.pm/db_connection/DBConnection.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

Screenshot 2019-06-21 at 12 29 27

Can it be some deadlock in this receive expression?

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 😀