-
-
Notifications
You must be signed in to change notification settings - Fork 587
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 crashes after reconnect to server with short reconnection_delay #1004
Comments
Here is output on Ubuntu 22.04, more details:
|
I suppose you might say the bug actually in aiohttp, but increasing reconnection delay does fix this. |
Yes, this is my bug. There are some cleanup tasks that occur after the reconnection loop begins. The solution is that I need to wait to begin the reconnection until those background tasks complete. If a new connection is attempted before these tasks are done, then you get strange results. I don't consider this a high priority issue because there is really no point in having reconnections that quickly (i.e. it would never make sense to do this in a production deployment as your server would be flooded with reconnection requests all at the same time and might die again due to the load spike). But it is a bug, so I will look into it. |
I'm OK with longer timeout. Maybe it could have been helped me to understand why my client crashes if it was mentioned in the docs, with some valid data as example. Just a short workaround for anybody else. |
I have consistent crashes with AsyncClient (v.5.7.1 and checked previous 5.6.0, 5.50 the same) with following slightly modified example from your documentation:
My socketio server is also written in Python and running on Ubuntu 22.04 machine as a daemon. So every time I execute:
That client crashes. Increasing reconnection_delay to 3-5-10 seconds does help. Sometimes even 1s is enough. The crash occurs after successful reconnect, that's weird.
Here is example of output when crashed:
On Windows:
The text was updated successfully, but these errors were encountered: