Closed tyldum closed 4 years ago
mst told me to revert commit 9b7e3bfde04c3d3022e12ea387643a78bec62a24, which is what I did in https://github.com/mojolicious/mojo-pg/compare/master...tyldum:revert-9b7e3bfde04c3d3022e12ea387643a78bec62a24
This fixes the issue for me in my lab setup.
Updated the linked fork with a reproducible test. Can create a MR if someone wants, but I considered it too trivial at this point. Besides, the test is a bit destructive in that it will close all connections to the current database, so YMMV if it's safe in your test env.
So, it's been two weeks and nobody has done this too trivial for a PR
fix?
Fixed in 4.17. But i'm still rather disappointed that this was not fixed already while i was on vacation.
Steps to reproduce the behavior
On a server that has Mojo:Pg connected issue this query to close all connections:
SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity
Expected behavior
Mojo::Pg should create a new socket to the server and execute query.
Actual behavior
Subsequent calls to
app->pg->db->query()
fails withDBD::Pg::st execute failed: no connection to the server
. It will never reconnect.