MagicStack / asyncpg

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

no attribute `_aborted` on `Connection.__del__` #1132

Closed samuelcolvin closed 6 months ago

samuelcolvin commented 6 months ago

I'm seeing this quite often when using a pool, I've checked the code, but can't imagine where it's coming from:

Exception ignored in: <function Connection.__del__ at 0x113f9dee0>
Traceback (most recent call last):
  File "/Users/samuel/code/logfire-demo/.venv/lib/python3.12/site-packages/asyncpg/connection.py", line 124, in __del__
    if not self.is_closed() and self._protocol is not None:
           ^^^^^^^^^^^^^^^^
  File "/Users/samuel/code/logfire-demo/.venv/lib/python3.12/site-packages/asyncpg/connection.py", line 1455, in is_closed
    return self._aborted or not self._protocol.is_connected()
           ^^^^^^^^^^^^^
AttributeError: 'Connection' object has no attribute '_aborted'

As far as I can tell I'm not doing anything different from normal usage of create_pool, I'm afraid the code isn't currently open source.

samuelcolvin commented 6 months ago

It's something weird we're doing, I'll close but if we get more information, we'll add details here.