ENG-3842: Add configurable pool_recycle for database connections#8209
Merged
Conversation
Expose a single FIDES__DATABASE__POOL_RECYCLE setting (Optional[int], must be > 0) that controls SQLAlchemy's pool_recycle across all engine types. When set, connections older than this many seconds are automatically recycled. Useful when a connection proxy or firewall imposes an idle connection timeout. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8209 +/- ##
=======================================
Coverage 85.61% 85.61%
=======================================
Files 658 658
Lines 42869 42872 +3
Branches 5019 5020 +1
=======================================
+ Hits 36701 36705 +4
Misses 5063 5063
+ Partials 1105 1104 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rayharnett
approved these changes
May 18, 2026
Contributor
rayharnett
left a comment
There was a problem hiding this comment.
Very small change to make the pool_recycle setting configurable for SQLAlchemy. No issues identified.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket ENG-3842
Description Of Changes
Adds a new
FIDES__DATABASE__POOL_RECYCLEconfiguration setting (Optional[int], must be> 0) that controls SQLAlchemy'spool_recycleacross all engine types (API sync, API async, task, async readonly). When set, connections older than this many seconds are automatically closed and replaced. This is useful when a connection proxy or firewall imposes an idle connection timeout.When unset (
None, the default), connections are never recycled — preserving current behavior with zero impact on existing deployments.Code Changes
pool_recyclefield toDatabaseSettingsindatabase_settings.pypool_recycleparameter toget_db_engine()insession.py, conditionally passed tocreate_enginepool_recyclethrough to all engine creation sites:session_management.py,tasks/__init__.py,ctl_session.pySteps to Confirm
FIDES__DATABASE__POOL_RECYCLE=1800and verify the setting is picked up on startupFIDES__DATABASE__POOL_RECYCLE=0or a negative value is rejected by config validationPre-Merge Checklist
CHANGELOG.mdupdated