-
-
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
Unsolicited response received on idle HTTP channel starting with "\r\n"; err=<nil> #2782
Comments
/cc @fafhrd91 |
Currently, I suggested to limit idleTimeout to golang client by 60 seconds, so it will close idle connection long before aiohttp does it itself with additional response data. But not sure if that's ok in general to tweak clients to let them work with aiohttp nicely. |
Shouldn't the server just close the connection? Another choice is shutdown the send side first, read and discard any received data for a short while, then close the connection, so the client won't receive broken pipe errors (but usually It is not worth doing this) |
That's how it was and the reason of current behaviour is about to fix that state
I didn't found any references in actual RFCs about such behaviour as like as I didn't noticed any recommended behaviour to avoid such issues. However, I didn't dig too much so could miss something. |
#1883 describes the problem. Maybe this should be configurable. I don’t have opinion |
@fafhrd91 is it an asyncio bug? Looks weird. |
It is reproducible |
Our backend is also Go calling out to asyncio/aiohttp, and I've been seeing this. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a [new issue] for related bugs. |
Long story short
By default, aiohttp closes keep-alive connections after 75 seconds of inactivity. Just before closing it, server sends
\r\n
data to client in order to notify it about closing. However, not all the clients are happy with that. One of those is standard golangnet/http
which logs errors in this case not about closed connection, but about bad data received in place when there should be any of such.Referenced commit: bf49f8e
Question is that behaviour correct or common, or based on some RFC?
What recommendations could we give to clients which complains about to relax their communication with aiohttp servers?
Expected behaviour
Actual behaviour
Steps to reproduce
examples/web_srv.py
main.go
, for example:go run main.go
Your environment
The text was updated successfully, but these errors were encountered: