Skip to content

Conversation

@v0idpwn
Copy link
Member

@v0idpwn v0idpwn commented Dec 16, 2025

Instead of terminating, the connection enters a waiting state, and responds to checkout attempts with:

Error: Authentication credentials are invalid. Please reconnect with fresh credentials to restore pool functionality.

This helps in a few situations:

  • Avoids restart loop when a pool has no client connections and stale credentials, and poolboy wants to start a db handler to keep it warm. Instead of trying to start a DbHandler that fails immediately, the DbHandler will be waiting until an user connects with fresh credentials, and only then tries to connect to the upstream db.

  • Avoids multiple wrong password attempts when credentials change with a pool running with multiple open connections. E.g.: assume we have 100 client connections, 10 db connections, and the user changes the password. Eventually, an 11th connection is needed. Starting the DbHandler with old credentials will fail with a bad password. Before, every attempt to create this 11th connection would result in an error. With 100 existing client connections, we could try to auth to the upstream db up to 100 times, if no new client connections came up to refresh our cache. This could lead supavisor to get banned by the upstream db. Now the 11th connection will hog a slot in the pool and refuse checkouts, so the pool continues existing, degraded, until a new connection comes up, without impacting connectivity to the upstream db.

@v0idpwn v0idpwn requested a review from a team as a code owner December 16, 2025 16:36
@v0idpwn v0idpwn force-pushed the fix/waiting-for-secrets branch from 644c5a1 to e77380c Compare December 16, 2025 16:37
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.

3 participants