python-trio / triopg

PostgreSQL client for Trio based on asyncpg
Other
45 stars 8 forks source link

ConnectionProxy doesn't detach conn when leaving async context #19

Open touilleMan opened 1 year ago

touilleMan commented 1 year ago

Originally reported by @vxgmichel

connection pool's acquire context manager returns a connection proxy object that can still be used after we have left the context manager (instead of raising an error)

This is because the triopg version of the connection proxy is missing an additional cleanup routine compared to what is done in asyncpg: https://github.com/MagicStack/asyncpg/blob/7cb4e70d88d165273997d914280c6d109fbbc8f6/asyncpg/pool.py#L78-L84