-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
The web socket handler is stuck in an undefined state if the client did not close properly #5301
Comments
Thanks for the report. I have a plan for working on it; I hope the fix will be a part of aiohttp 3.8 |
Thanks @asvetlov |
Hi, thanks for this awesome project.
|
I would assume that @asvetlov hasn't had a chance to look at it yet. If anyone else wants to propose a solution, we're happy to look at a PR. |
I investigated the issue some more, and I may have found the original reason. This is because a msg with type Lines 458 to 461 in 50fec95
but this type doesn't raise a StopAsyncIteration :Lines 512 to 516 in 50fec95
Thus a client will continue waiting forever in the closed websocket iterator. And, (in our case), as it considers the socket opens, also tries to write to it (hence the "ConnectionResetError: Cannot write to closing transport" error). As the |
Potentially promising. Do you think you can add a test case that reproduces the issue now? |
Actually that's not the cause of the issue. On next call, as connection is closed, |
What's the current status of this? This issue is hurting us with an implementation of a websocket server. |
This might already be fixed in 3.9.x. Can you verify the issue still persists? |
This looks fixed Reproducer on older aiohttp
|
@mykola-mokhnach Can you still reproduce this after #7978 ? |
馃悶 Describe the bug
The server socket listener is forever stuck in web socket messages loop if the client does not close the socket properly
馃挕 To Reproduce
websocat
tool (brew install websockat
on macOS)An exception is written to the log. The web socket does never get closed and is practically stuck in messages loop.
馃挕 Expected behavior
The server should properly close the client connection after STR and exit the messages loop
馃搵 Logs/tracebacks
馃搵 Your version of the Python
馃搵 Your version of the aiohttp/yarl/multidict distributions
馃搵 Additional context
The text was updated successfully, but these errors were encountered: