-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
http3: reset stream when a handler panics #4181
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4181 +/- ##
==========================================
- Coverage 83.77% 83.74% -0.04%
==========================================
Files 150 150
Lines 15425 15475 +50
==========================================
+ Hits 12922 12958 +36
- Misses 2006 2019 +13
- Partials 497 498 +1 ☔ View full report in Codecov by Sentry. |
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.
If the panic happens before we've written the HTTP header, should we just write the 500 and close the stream?
What does HTTP/2 do in both these cases? |
HTTP/2 doesn't differentiate between these two cases. It will reset the stream if there is a panic. |
Per
There is no mention of interpreting the panic and handling it the other way. And it's actually doing that. |
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.
Thank you @WeidiDeng, and sorry for the delay in reviewing this PR! This will be part of the next quic-go release.
When debugging an issue for caddy, I found http3 server handler will not correctly propagate stream error. Code example here.
In this case
Content-Length
is set, http3 may use that info to infer the stream doesn't terminate properly. But in a streaming environment if there is an error upstream, client should be able to know there is an error at a stream level just like http2 regardless of the presence ofContent-Length
.