Open Korayem opened 2 weeks ago
+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