-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Response timeout error from all routes after returning several timeouts from a specific route #1875
Comments
If I add this to the server, no more errors will occur for other routes:
Which means I deleted this part of the original code:
But this is not the right solution! |
Thanks for reporting and triaging this. Multiple error responses corrupting HTTP connections was one of the bugs fixed in the yet-to-be-released
Could you check if that branch solves your problem, so that we can further confirm this and see what needs to be done? Do note that you cannot use custom protocol with the new branch due to the way it restructures everything. |
Thank you for your reply. |
I've asked other core developers for discussion about what to do about it, as directly fixing in master might easily introduce new bugs elsewhere, so care must be taken. I hope that your situation isn't the most pressing sort, because this will in any case take a while to get fixed and released, and probably won't make it into the upcoming 20.6 release. Technical summary: the current error handling logic may in some situations end up writing a response when one was already sent, corrupting the next request on the same HTTP keep-alive connection. This obviously needs to be avoided (without ever omitting a response in other circumstances). Due to the way the asyncio code, error handling and cancellation are structured, this isn't as trivial as it sounds. Keeping this report open for tracking the issue. |
I know it is not the "right solution" either to just hold off and wait. But, I do not want to add any breaking changes between now and December's LTS. The streaming is set to be added for 21.3. If this turns out to be a larger issue, maybe then we can look to see if there is a temporary patch. In the absence of that, my vote is to wait. |
Response timeout error
Return "Response timeout" error from all routes after returning several timeouts from a specific route.
Codes
Set response timeout to 5 sec in config:
RESPONSE_TIMEOUT = 5
Define funcs:
Make several timeout responses:
Then if I request all other endpoints, it returns "Response timeout" error:
resp = requests.get('/test2')
Environment:
The text was updated successfully, but these errors were encountered: