Connection Pool: Acquire Connections from Pool #1162
Unanswered
whilsman-tmt
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently testing using asyncpg for connecting to AWS RDS Aurora specifically using IAM credentials as the password. Given the nature of IAM tokens with AWS they will expire after a duration of fifteen minutes and are no longer be usable to connect to a database. With the usage of these credentials though a user if still connected to the database after fifteen minutes will still be able to perform transactions.
What I am struggling to understand right now is how connections are created from the
async with pool.acquire() as con
. My assumption is that each time a new connection is needed using the mentioned method it needs to establish a new connection to the database. My test right now involves waiting sixteen minutes AFTER my first connection is acquired from the pool. I'd assume that given the nature of IAM credentials this would not work given that they have expired after fifteen minutes from their generation. So in short my questions are:pool.acquire()
method is called AND the current size of the pool is zero , and idle connections are not present is there some type of replication of connections occurring?pool.acquire()
method is called is a new connection created when there are no idle connections, or connections in the pool?Posting my spaghetti code below. Will be cleaning it up today as I've just been trying to force this.
Beta Was this translation helpful? Give feedback.
All reactions