Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pg_ready failed: connection not open #87

Open
ayokh75 opened this issue Dec 20, 2023 · 1 comment
Open

pg_ready failed: connection not open #87

ayokh75 opened this issue Dec 20, 2023 · 1 comment

Comments

@ayokh75
Copy link

ayokh75 commented Dec 20, 2023

  • Mojo::Pg version: 4.27
  • Perl version: 5.32
  • Operating system: Red Hat Enterprise Linux 8.8 (Ootpa)

Steps to reproduce the behavior

Currently no systematic way found to reproduce the observed error;

Mojo app running behind HA proxy, PG Pool and 2 Postgres servers (Primary and Secondary) (Mojo app -> HA Proxy -> Pgpool -> Postgres).
Under heavy DB async query load when DB cluster switches from primary to secondary the following logs are observed repeatedly and the Mojolicious server app becomes unresponsive to http requests:

Mojo::Reactor::EV: I/O watcher failed: DBD::Pg::db pg_ready failed: connection not open at /tmp/par-656d75/cache-5a13761dff7eacf51565680336f8b5781c26f7aa/inc/lib/Mojo/Pg/Database.pm line 173.
DBD::Pg::db pg_notifies failed: connection not open at /tmp/par-656d75/cache-5a13761dff7eacf51565680336f8b5781c26f7aa/inc/lib/Mojo/Pg/Database.pm line 142.
DBD::Pg::db pg_ready failed: connection not open at /tmp/par-656d75/cache-5a13761dff7eacf51565680336f8b5781c26f7aa/inc/lib/Mojo/Pg/Database.pm line 173.

Also the following logs are observed:
Mojo::Reactor::EV: I/O watcher failed: DBD::Pg::db pg_ready failed: server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request. at /tmp/par-656d75/cache-d8b4d457ad057b3482a456dcf4386549533fd53d/inc/lib/Mojo/Pg/Database.pm line 173.

And the following too which means the Mojo app server has to be restarted to function again:
Mojo::Reactor::EV: I/O watcher failed: DBI connect('dbname=appDb;host=localhost;port=5433','dbUser',...) failed: server closed the connection unexpectedly
his probably means the server terminated abnormally
before or while processing the request. at /tmp/par-656d75/cache-5a13761dff7eacf51565680336f8b5781c26f7aa/inc/lib/Mojo/Pg.pm line 73.

Expected behavior

To be able to reconnect to the DB once Postgres server is available again without restarting the Mojo app;

Actual behavior

As explained in '### Steps to reproduce the behavior' section above;

@kraih
Copy link
Member

kraih commented Dec 20, 2023

This seems hard to replicate. Doubt it will be fixed quickly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants