Skip to content

no attribute _aborted on Connection.__del__ #1132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
samuelcolvin opened this issue Mar 14, 2024 · 2 comments
Closed

no attribute _aborted on Connection.__del__ #1132

samuelcolvin opened this issue Mar 14, 2024 · 2 comments

Comments

@samuelcolvin
Copy link
Contributor

  • asyncpg version: 0.29.0
  • PostgreSQL version: PostgreSQL 14.11 (Homebrew) on aarch64-apple-darwin23.2.0, compiled by Apple clang version 15.0.0 (clang-1500.1.0.2.5), 64-bit
  • Do you use a PostgreSQL SaaS? If so, which? Can you reproduce
    the issue with a local PostgreSQL install?
    : NA
  • Python version: 3.12.2
  • Platform: MacOS M1
  • Do you use pgbouncer?: NO
  • Did you install asyncpg with pip?: rye/uv also tried with pip - same result
  • If you built asyncpg locally, which version of Cython did you use?: NA
  • Can the issue be reproduced under both asyncio and
    uvloop?
    : yes

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 samuelcolvin changed the title 'Connection' object has no attribute '_aborted' on Connection.__del__ no attribute '_aborted' on Connection.__del__ Mar 14, 2024
@samuelcolvin samuelcolvin changed the title no attribute '_aborted' on Connection.__del__ no attribute _aborted on Connection.__del__ Mar 14, 2024
@samuelcolvin
Copy link
Contributor Author

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

@meliascosta
Copy link

meliascosta commented Oct 23, 2024

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

Hey! I'm getting the same error could you give a hint about how you solved the issue without revealing closed source code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants