Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#3332] Properly close database connections in background workers
RQ background workers exit via `os._exit`, which (by design) omits all of Python's usual clean up routines. As a result, the SQLAlchemy session and its associated database connections have to be cleaned up manually. This hadn't been done before, leading to sporadic exceptions due to SSL connections being unexpectedly closed. This commit fixes that situation by properly closing each worker's SQLAlchemy session and its associated database connections.
- Loading branch information
Showing
2 changed files
with
20 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters