Prevent database connection leaks in config helpers #3452 issue resolved
Fix: Prevent database connection leaks in config helpers
- Ensured all AugurConfig value lookups (get_redis_conn_values, get_rabbitmq_conn_string) are performed inside active DatabaseSession context managers.
- Adjusted DatabaseSession lifecycle to avoid disposing shared engines prematurely.
- Corrected recursive insert logic to merge results and prevent hidden leaks during retries.
- Added safety checks for empty config strings and fixed variable naming typo. This resolves the issue where repeated calls to get_redis_conn_values opened new DB connections that were never closed. With this fix, connection pool usage remains stable under repeated calls.
Can you make the title of your pull request more descriptive of what is actually being fixed? Raw issue numbers by themselves arent very easy to read/understand at a glance
Can you make the title of your pull request more descriptive of what is actually being fixed? Raw issue numbers by themselves arent very easy to read/understand at a glance
fix: correct regex parsing of PostgreSQL connection string what I tried to do:- This update improves the parse_database_string function so it correctly pulls out the username, password, host, port, and database from a PostgreSQL connection string. If the input doesn’t match the expected format, the function now raises a clear ValueError instead of silently failing. The changes are kept focused only on the parsing logic, without any unrelated reformatting, to make the review straightforward.
fix: correct regex parsing of PostgreSQL connection string what I tried to do:- This update improves the parse_database_string function so it correctly pulls out the username, password, host, port, and database from a PostgreSQL connection string. If the input doesn’t match the expected format, the function now raises a clear ValueError instead of silently failing. The changes are kept focused only on the parsing logic, without any unrelated reformatting, to make the review straightforward.
This is a completely different and unrelated fix than the one in the initial issue description you provided.
Ensured all AugurConfig value lookups (get_redis_conn_values, get_rabbitmq_conn_string) are performed inside active DatabaseSession context managers.
Several maintainers have tried solving this issue in the past, and I really dont think this is it.
I dont really see a realistic path to this getting merged, so i'm going to close it