Skip to content

fix(database): retry on the same pool after a lost connection - #4

Merged
RejectModders merged 1 commit into
mainfrom
fix/database-retry
Nov 30, 2026
Merged

RejectModders merged 1 commit into
mainfrom
fix/database-retry

Conversation

@RejectModders

Copy link
Copy Markdown
Member

When a query hit a lost connection, the pool built a second pool of ten connections and then ran the query on the first one anyway, so each failure left more connections open. asyncpg replaces a lost connection itself, so the query is now tried once more on the same pool.

Tested: two new tests in tests/test_database_tls.py fail before the change and pass after it. Not tried against a real database.

Each lost connection built another pool of ten connections and then ran the query on the old one anyway. The pool replaces a lost connection itself, so one more try is enough.
@RejectModders
RejectModders merged commit 417a11e into main Nov 30, 2026
6 checks passed
@RejectModders
RejectModders deleted the fix/database-retry branch November 30, 2026 03:22
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.

1 participant