-
-
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uvloop: after CancelledError web response still tries to write EOF to closed socket #1790
Comments
@1st1 could you check? should aiohttp handle this case differently? |
I'll take a look at the code later, but maybe you can check |
I'd rather not, but I can just add try/except for RuntimeError |
The weird thing is that it's handled correctly in the normal event loop. Suppressing RuntimeError seems dangerous, there are many things that can raise that and we might not be notified of different bugs. |
Why not? It's not safe to suppress RuntimeErrors |
I think I'll allow |
I'm looking at the traceback and I'm not sure why |
The weird thing is that besides the exception we also get the log |
Never mind, there is another identical log message in the |
this is classic async problem.
that is the reason why RuntimeError is not good idea in async transport. similar to python/cpython#528 |
added special case for RuntimeError logging |
Long story short
If a CancelledError is raised while a web response handler is waiting for it's data, aiohttp fails when trying to write EOF to the closed socket.
This issue only happens when using UVLoop. If I use UnixSelectorEventLoop (default on OS X) I do not experience this issue. That's why I am not 100% sure if this issue is related to aiohttp or UVLoop. I will work on getting an isolated test case together tomorrow.
Expected behaviour
Premature client cancelling should be handled correctly.
Actual behaviour
Right after this exception, aiohttp writes to the debug log (in both loops):
Ignored premature client disconnection.
Steps to reproduce
Going to sleep first, will get to this tomorrow 👍
Your environment
OS X, aiohttp 2.0.5
The text was updated successfully, but these errors were encountered: