-
Notifications
You must be signed in to change notification settings - Fork 765
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
Postgres doesn't reconnect after idle time #541
Comments
+1 |
This error is also raised when one attempts to close an already closed connection. Re-establishing a connection, in this case, would be undesired behavior. This is likely also a feature we would want to apply across the board. I recommend an implementation similar to: https://github.com/django/django/blob/main/django/db/backends/base/base.py Also, what are your configuration settings/plugins? Postgres should be keeping connections alive indefinitely by default |
Describe the bug
connect_to_postgres() code aparently doesn't handle situations where connection is closed after some idle time
To Reproduce
Steps to reproduce the behavior:
psycopg2.InterfaceError: connection already closed
Expected behavior
App should detect connection is closed and re-establish a new connection
Error logs/Screenshots
psycopg2.InterfaceError: connection already closed
Desktop (please complete the following information where):
Additional context
Potential Solution: https://stackoverflow.com/a/74328338/80434
The text was updated successfully, but these errors were encountered: