-
Notifications
You must be signed in to change notification settings - Fork 2
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
Reopen postgresql db connection to be more robust #12
Comments
Did some planning and also talked to @bernhard-herzog: This is a task which requires some code changes.
To make the code easier to read it would be good to use a function to get new connections. In addtion a |
Considered a workaround to limit the time an apache WSGI process runs, to make the process self healing. A simple change to modify the WSGIDaemonProcess www-fody threads=1 maximum-requests=10000 restart-interval=3600 graceful-timeout=30 does not work on Ubuntu 16.04LTS, because it would require at least http://modwsgi.readthedocs.io/en/latest/release-notes/version-4.5.12.html#new-features |
For the evaluation of this issue: the operating instructions (currently part of the |
That need administrator attention and manual intervention. However, it can be handled automatically. |
@wagner-certat we seem to agree that the current behavior can be improved. Which is the purpose of this issue after all. |
This is still an issue. If the DB was gone and is back up, the backend continues throwing 500s:
|
This is what a DB restart (recovery after error in WAL) caused for the ticket api:
|
ffb268e v0.5.1 will fail if a database connection is closed.
Apache's mod_wsgi may restart the processes onces in the while, so there is some self healing.
Simple test to reproduce:
systemctl restart postgresql.service
in a running contactdb_api results intoTechnical idea:
Use psycopg2.pool.ThreadedConnectionPool().
This might also help to speed up access and use multiple threads with wsgi,
which would need an update in the Apache config instructions.
The text was updated successfully, but these errors were encountered: