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
AttributeError: 'NoneType' object has no attribute 'cancelled' #240
Comments
Seems like a race. My best guess would be that |
Hi @elprans again it occurs when HA clusters are deployed, meaning single-instance and/or non-proxied connections seems to be stable. This is then expected behavior? This is hurting us because we have special treatment of all connection related exceptions and issues, but obviously not for AttributeError which could mask our own development errors. |
No, this is definitely a bug. Until we find a good way to reproduce, and if it really bothers you, you can try adding asyncpg/asyncpg/protocol/protocol.pyx Line 745 in 8cec66f
|
@elprans, I also have a similar issue
One way how to reproduce is to insert a lot of values using loop |
Hav
Have same issue |
This issue still exists in 0.22.0, and I think I know the cause. I can reproduce it pretty consistently with this:
This works fine when connected to a local DB, but with a remote one it will print
What we expect to happen:
But as you can see from the output, there are 2 messages received back to back, without the sink coroutine being executed. Consequently the read loop doesn't create a new waiter, hence the exception on the next call to I think the problem is the assumption that, when we receive I've created a pretty rough fix that makes |
Hi @dddsnn. Thanks for diagnosing the issue! I'm aware of it, as it recently popped up while testing on aarch64, and I've been looking into fixing this. This issue isn't specific to just Copy, I'm afraid, although it is easiest to get triggered by Copy. The real fix would have to be a bit more invasive. |
I've been getting this error recently as well. |
Have stuck with the same bug (using
For those getting this bug on PGSQL |
I just hit this w/ |
FYI, I have the same issue (using |
Any idea on this @elprans ? Occurs for me as well lately with asyncpg 0.29.0 and python 3.11.x. Also using uvloop does not fix this as suggested above.
EDIT: |
the issue with a local PostgreSQL install?: I can't reproduce
uvloop?: No
Same query sometimes breaks with this, meaning the exact query other times works flawlessly, any ideas?
The text was updated successfully, but these errors were encountered: