encode / databases

Async database support for Python. 🗄
https://www.encode.io/databases/
BSD 3-Clause "New" or "Revised" License
3.85k stars 262 forks source link

Issue with the Advisory Lock #518

Open jageshmaharjan opened 2 years ago

jageshmaharjan commented 2 years ago

asyncpg version: 0.25.0 PostgreSQL version: 12.11

We have been frequently receiving this Timeout Error

asyncio.exceptions.TimeoutError
[View similar errors](https://link.datadoghq.com/apm/error-tracking?issueId=...471-da7ad0900002)

Traceback (most recent call last):
  File /usr/local/lib/python3.9/site-packages/ddtrace/contrib/asyncpg/patch.py, line 89, in _traced_query
    return await method(*args, **kwargs)
File asyncpg/protocol/protocol.pyx, line 338, in query
asyncio.exceptions.TimeoutError

upon checking the logs, it's making an internal query SELECT pg_advisory_unlock_all ( ) CLOSE ALL UNLISTEN * RESET ALL on PostgreSQL database

Not sure why the tables are locking when we are only doing read operations from the db.