You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The below seems to be a common (incorrect) pattern of use:
asyncwithpool.acquire() asconn:
# 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
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).
The text was updated successfully, but these errors were encountered:
elprans
changed the title
Issue a Warning whenever a connection with unclosed resources is released to a pool
Guard against improper use-after-release of connection resources
Sep 11, 2017
We already check for attempts to use connection methods after the
connection has been returned to the pool. This adds a similar check
for objects associated with the connection: prepared statements and
cursors.
Issue: #190.
We already check for attempts to use connection methods after the
connection has been returned to the pool. This adds a similar check
for objects associated with the connection: prepared statements and
cursors.
Issue: #190.
The below seems to be a common (incorrect) pattern of use:
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 (eitherASYNCPGDEBUG
, orPYTHONASYNCIODEBUG
, or both).The text was updated successfully, but these errors were encountered: