-
Notifications
You must be signed in to change notification settings - Fork 55
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
Pool doesn't reconnect when DB server is restarted #68
Comments
When I made a few more attempts, it looks like the Pool reinstated the lost connections and started functioning again. Updated questions:
|
having same issue
|
Right now, connection validation is not guarded with a timeout. So if the network request hangs for some reason or the driver got stuck, then the blocker propagates all the way down. Adding a timeout to the validation should address the issue. |
We now apply the connection acquisition timeout to the validation to avoid hanging connections. [#68]
We now apply the connection acquisition timeout to the validation to avoid hanging connections. [#68]
To @michaelr524's question: The pool cannot be cleared. That's a feature that needs to be provided by reactor-pool first. The change is available in |
Seems like I have related issue.
I kill leader postgres, patroni successfully propagates it to another node and I expect above code to reconnect after some delay. When I use PostgresqlConnectionFactory without a pool, everything works fine. A new connection initiated on each attempt and after some delay, it successfully establishes and continues to save data. But when I add r2dbc-pool
when pool loses postgresql it seems like it does not try to reconnect at all
I independently checked with plsql that a new leader successfully goes online, but r2dbc-pool cannot establish new connection and retries continue. I just tried 0.8.3.BUILD-SNAPSHOT but it did not help. |
I successfully validated that the pool invalidates the connection with Toxiproxy and a remote server that either dropped connections or where the remote process was killed entirely. In both cases, the pool recovered (see the log output). I'm closing this issue as solved. Feel free to submit a fully reproducible test case if the issue arises again. |
Hi @mp911de can you outline the configuration you used to provide autoreconnect? I am trying to implement reconnects with postgresql but the connection pool becomes stagnate after an error |
We're happy if you can provide a reproducer (even one using mocked connections would be fine) so we can sort out any pool reliability issues. |
I restart the DB (postgres) when the pool is running and from that moment I get the below error on any DB access query attempt.
The text was updated successfully, but these errors were encountered: