fix: make PostgreSQL reconnect retry interval configurable - #2585
Open
ayush213 wants to merge 2 commits into
Open
fix: make PostgreSQL reconnect retry interval configurable#2585ayush213 wants to merge 2 commits into
ayush213 wants to merge 2 commits into
Conversation
ayush213
force-pushed
the
fix-pg-retry-interval
branch
from
September 6, 2026 08:52
9caff6a to
8b9ee45
Compare
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.
Problem:
When a PostgreSQL connection is lost, Drogon automatically attempts to reconnect every 1 second via loop->runAfter(1, ...) inside orm_lib/src/DbClientImpl.cpp. This can cause unnecessary CPU usage, excessive connection attempts, and log spam when PostgreSQL is unavailable for an extended period.
Solution:
Added configuration support to make the PostgreSQL reconnection retry interval customizable instead of hardcoded to 1 second.
Updated orm_lib/src/DbClientImpl.cpp to parse and apply the user-defined retry interval to the reconnection loop timer.
Reduced unnecessary resource consumption during extended database outages.
Closes #2581