disconnected: ** (DBConnection.ConnectionError) client #PID<[XXX]> exited #616
jonleighton
started this conversation in
General
Replies: 1 comment
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I thought I'd share that I've been working recently on fixing a flakey Wallaby test that was sometimes failing on CI with the above error.
I managed to isolate the cause, which is explained here: elixir-ecto/db_connection#247
TL;DR: when a browser aborts a request, the Cowboy2 server kills the process tree associated with that request. If a database connection (shared via
Phoenix.Ecto.SQL.Sandbox
) was in use at that time, the connection would become corrupted. After that, future requests, and the test that owns the connection, would be unable to use it.Here's a test which reproduces the situation: jonleighton/db_connection_ownership_bug@922bbd8
And a fix has already gone into
phoenix_ecto
, so this shouldn't happen in future releases: phoenixframework/phoenix_ecto@1d8d28aBeta Was this translation helpful? Give feedback.
All reactions