Skip to content

Repository/Connection pool seems to hang #2946

@tverlaan

Description

@tverlaan

From time to time we experience an issue in our production environment where we stop being able to execute database queries. We measure the amount of queries we do with telemetry and it drops to 0. The only way we have been able to mitigate this is by restarting our entire application. Just restarting our repository didn't resolve the issue.

We have been unable to find the root cause and so far we haven't been able to reproduce this somewhere else than production. This makes it quite hard for us to identify the bug or creating a reproducible scenario. Doing queries from the console also doesn't work anymore, but for me the strange thing is that it actually "hangs" the console and we don't see any logs related to that. Perhaps there is a good explanation of this which we've been unable to come up with.

We use fairly default config with a pool size of 10.

Any pointers to what steps we can take to further investigate/debug this would be appreciated.

Environment

  • Elixir version: 1.7
  • Erlang version: 21
  • Database and version: Postgres 9.4 (with BDR 1.0)
  • Ecto version: 3.0.6
  • Ecto SQL version: 3.0.4
  • Database adapter and version: Postgrex 0.14.1
  • Operating system: Ubuntu Xenial

Current behavior

When we query using Repo.query("SELECT 1") from iex the console seems to hang forever. It doesn't return anything.

Expected behavior

I would expect to receive an error or some log line why it doesn't return anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions