-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pool connect ignores DNS ttl #254
Comments
See #253 (which supersedes #249), which attempts to address this exact issue by tracking the consecutive number of exceptions that a connection has incurred. After the max is reached, the connection is closed so that a new one can be added to the pool. We've found this to have effectively mitigated our failover issues (also using RDS). You can install it by adding the following to your
(plain pip)
|
Though, after reading the code you pointed to more closely, it may be better handled by updating the connection logic to not cache (or, optionally so) the resolved address |
See specifically this commit which will cause a pool to cycle through your provided hosts again should a connection end up being closed due to too many consecutive exceptions |
asyncpg does not perform any name resolution itself, |
the issue with a local PostgreSQL install?: Using AWS RDS
uvloop?: We only use asyncio
After performing a failover/reboot of an AWS RDS instance asyncpg does not appear to reconnect gracefully - it looks like the code in
Pool
caches the IP of the PG instance after dns resolution and does not respect whatever TTL we might have set on the cname that points at our master: https://github.com/MagicStack/asyncpg/blob/master/asyncpg/pool.py#L133The text was updated successfully, but these errors were encountered: