Skip to content

fix: make PostgreSQL reconnect retry interval configurable - #2585

Open
ayush213 wants to merge 2 commits into
drogonframework:masterfrom
ayush213:fix-pg-retry-interval
Open

fix: make PostgreSQL reconnect retry interval configurable#2585
ayush213 wants to merge 2 commits into
drogonframework:masterfrom
ayush213:fix-pg-retry-interval

Conversation

@ayush213

@ayush213 ayush213 commented Sep 5, 2026

Copy link
Copy Markdown

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

@ayush213
ayush213 force-pushed the fix-pg-retry-interval branch from 9caff6a to 8b9ee45 Compare September 6, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL reconnect retry interval should be configurable

1 participant