Skip to content

fix: prevent connection storm during outage recovery - #7

Open
jearthliu wants to merge 2 commits into
colmev080:mainfrom
jearthliu:fix/connection-storm-protection
Open

fix: prevent connection storm during outage recovery#7
jearthliu wants to merge 2 commits into
colmev080:mainfrom
jearthliu:fix/connection-storm-protection

Conversation

@jearthliu

Copy link
Copy Markdown

Counts pending dial attempts toward MaxConns so a burst of blocked Acquire() calls waking up after an outage cannot each start its own dial — protecting PostgreSQL max_connections. Pending counter decrements on every failure path (dial timeout, ctx cancellation, auth failure) to avoid pool starvation, and a new conn is registered before capacity is released to avoid an undershoot window. Closes #3.

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.

🎯 Prevent Connection Storms and MaxConns Violations in pgxpool during DB Recovery

1 participant