-
-
Notifications
You must be signed in to change notification settings - Fork 756
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
Fix 0.30.4 issue with connection close header #2408
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous test was good, no need to modify it.
Your test is not representative, is it? Can we have a test with a POST request and connection: close
header?
Hi @Kludex , While pre-existing |
Yeah, but it's a POST request, and it's reading the body. But that test doesn't have the
It's a valid test anyway. |
Ahh got your point. So I can just implement a POST test case with Should I include that test case too? While reverting the current one back to the original state. |
I mean, that's the case you want to really handle here, right? If yes, then the answer is yes.
Yes, please. |
tests/protocols/test_http.py
Outdated
] | ||
) | ||
|
||
CONNECTION_CLOSE_POST_REQUEST_WITHOUT_BODY = b"\r\n".join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this one. The above case is fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this case of POST without body. Kept POST with body and connection close header
tests/protocols/test_http.py
Outdated
@@ -998,8 +1014,8 @@ async def test_return_close_header(http_protocol_cls: HTTPProtocol): | |||
|
|||
|
|||
async def test_close_connection_with_multiple_requests(http_protocol_cls: HTTPProtocol): | |||
app = Response("Hello, world", media_type="text/plain") | |||
|
|||
response_content = b"Hello, world" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add a diff here please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed diffs
I was wondering why the newly installed uvicorn wasn't responding. Turns out, the problem was here! Although I managed to pinpoint the issue myself, it looks like it's already been fixed. This bug has a significant impact, so I hope a new version can be released soon. Thanks! |
This is fixed in 0.30.5. |
Sorry for the problem caused due to the previous fix. :) |
Nah, it's fine. :) |
Summary
When
connection: close
header is passed to uvicorn server,RequestResponseCycle
'sreceive
method goes into waiting state. Resulting in request timeout or explicit connection close action from the client.This PR will fix the issue.
Detailed RCA: #2375 (comment)
Checklist