MagicStack / asyncpg

A fast PostgreSQL Database Client Library for Python/asyncio.
Apache License 2.0
7.02k stars 402 forks source link

Disconnection from postgres-compatible google cloud AlloyDB instance hangs #962

Open seandavi opened 2 years ago

seandavi commented 2 years ago

I am connecting to an AlloyDB instance on Google Cloud (currently, these are available for free testing). I can connect and queries run as expected. However, connection.disconnect() hangs. I cannot reproduce this behavior locally; disconnection happens as expected. Synchronous database work with psycopg2, for example, works as expected.

This code reproduces the behavior I am seeing (running through the alloydb-auth-proxy as is required):

import asyncpg
conn = await asyncpg.connect(ALLOYDB_URI)
conn.disconnect() # hangs

I'll put in a ticket with Google as well if nothing obvious turns up here.

seandavi commented 2 years ago

As just another small data point, aiopg does not have the behavior above and disconnects as expected.