Closed
Description
The below seems to be a common (incorrect) pattern of use:
async with pool.acquire() as conn:
# await conn.add_listener
# await conn.prepare
# etc
# Incorrect assumption that the listeners and prepared statements would continue to
# work beyond the `conn` acquisition context
See #189 for an example issue.
To give a better hint that this is not a valid thing to do, we should check if conn
has unclosed resources on it before releasing it. Possibly, behind a debug flag (either ASYNCPGDEBUG
, or PYTHONASYNCIODEBUG
, or both).