-
-
Notifications
You must be signed in to change notification settings - Fork 595
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
AsyncClient blocks thread when connection drops; cannot reconnect #401
Comments
Here is the result of
|
Questions:
I also have a request. Could you run your client with logging and capture a few lines when it reaches the high-consuming CPU state? Just change to this to log:
|
I modified my test script to your instruction. The output:
Also, it's possible to recover if I reconnect to the Internet before the first |
|
This isn't a reconnection problem. The network reads after you interrupted the network are not failing for you, they keep returning the last packet over and over instead of detecting that the network is down, which really makes no sense at all. Anything unusual about your networking set up? I suggest you try a different computer with different hardware to see if you get the normal behavior, which is that the read should raise an exception when the connection or the network are gone. |
I think it isn't a problem of my network. The packet is NOOP, not PONG. |
I tested on a cheapest droplet on Digital Ocean with Python 3.6.9 and Linux 4.15.0-66-generic Ubuntu. The result is the same. First, I ran the following script with
Then I blocked all the IP address of What follows is the same as on my computer, infinite debug messages and 100% CPU load. P.S. My computer has Python 3.8.0 and Linux 5.4.5-arch1-1. |
The aiohttp websocket client appears to not be detecting disconnects. I have to debug this more, but it does appear that this is a bug in aiohttp. I haven't found a workaround yet. Possibly related: aio-libs/aiohttp#2309 and aio-libs/aiohttp#4153. |
@buckle2000 can you install python-engineio master branch and retry? I believe I have found a workaround. |
It is fixed. The output is now:
|
Thanks for making this library. Don't forget to release the fix to PyPI. |
Whenever the connection drops, this library takes up 100% CPU on my computer. I tried increasing the delay to
reconnection_delay=10, reconnection_delay_max=3600
, but it blocks the thread.How to reproduce the bug
The text was updated successfully, but these errors were encountered: