MagicStack / MagicStack/asyncpg

Disconnection from postgres-compatible google cloud AlloyDB instance hangs

Open
#962 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
8.1k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

  • asyncpg version: 0.26.0
  • PostgreSQL version: Google AlloyDB, postgres 14.4 compatible
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    : I cannot reproduce the issue on a local postgres, no.
  • Python version: 3.10
  • Platform: Macos
  • Do you use pgbouncer?: No
  • Did you install asyncpg with pip?: Yes
  • If you built asyncpg locally, which version of Cython did you use?: NA
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : I have not tried to reproduce under uvloop

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the connection.disconnect() call in the provided AlloyDB-auth-proxy reproduction and run it against the reported Google Cloud AlloyDB setup. Compare the behavior with a local PostgreSQL installation and the existing psycopg2 behavior; done means identifying the cause of the hang and ensuring asyncpg disconnects cleanly for this setup.

Written by the indexing model from the issue text.

Assessment

Tech stack
gcp, postgresql, python
Domain
cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.