Drain request body in WSGI on request error #93
Merged
+11
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
gunicorn continues to have flakiness but the errors are different and now point to something which I think we can actually fix. With HTTP/1, it's technically not valid to close the response without fully reading the request, most clients will treat this as a connection error instead of reading the response. This could be handled at the app server layer, which is true for both pyvoy and unicorn at least. gunicorn doesn't though. Go doesn't either actually and connect-go does have a similar drain
https://github.com/connectrpc/connect-go/blob/59cc6973156cd9164d6bea493b1d106ed894f2df/compression.go#L101
They don't have an HTTP/1 vs 2 guard there but unless we find issues again later, I would lean on only doing it on HTTP/1 so that max message size limits can be more strict on HTTP/2 where it is valid to end a stream in the middle.
I guess we should probably do similar in async but as we currently don't have any issues there, I will follow up on whether it would fix granian's conformance tests.