-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
quiche: add 100 continue support #14246
Conversation
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
/assign @alyssawilk |
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.
Awesome - so exciting to see the corner cases in QUIC getting handled!
response_decoder_->decodeHeaders( | ||
quicHeadersToEnvoyHeaders<Http::ResponseHeaderMapImpl>(header_list), | ||
/*end_stream=*/fin); | ||
ENVOY_STREAM_LOG(debug, "Receive headers: {}.", *this, header_list.DebugString()); |
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.
Receive -> Received, here and below
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.
done
const uint64_t status = Http::Utility::getResponseStatus(*headers); | ||
if (status >= 100 && status < 200) { | ||
// These are Informational 1xx headers, not the actual response headers. | ||
ENVOY_STREAM_LOG(debug, "Received informational response code: {}", *this, status); |
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.
is this redundant given full headers logged above?
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
std::unique_ptr<Http::ResponseHeaderMapImpl> headers = | ||
quicHeadersToEnvoyHeaders<Http::ResponseHeaderMapImpl>(header_list); | ||
const uint64_t status = Http::Utility::getResponseStatus(*headers); | ||
if (status >= 100 && status < 200) { |
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.
CodeUtility::is1xx ?
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.
done
Signed-off-by: Dan Zhang <[email protected]>
std::unique_ptr<Http::ResponseHeaderMapImpl> headers = | ||
quicHeadersToEnvoyHeaders<Http::ResponseHeaderMapImpl>(header_list); | ||
const uint64_t status = Http::Utility::getResponseStatus(*headers); | ||
if (Http::CodeUtility::is1xx(status)) { |
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.
So what happens with 1xx headers which are not 100-continue?
For non-QUIC we send them up via decodeHeaders.
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.
Oh, I didn't know that. Currently we drop these headers on the floor. Will fix it.
Question please: QUIC doens't support 101 response code: https://tools.ietf.org/html/draft-ietf-quic-http-32#section-4.3. What shall we do in that case?
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.
oh fair point. maybe treat it as invalid and fast-fail the response then?
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.
Re-wrote 1xx header handling logic here. PTAL!
This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 37 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Signed-off-by: Dan Zhang <[email protected]>
Can someone reopen this PR? |
/retest |
Retrying Azure Pipelines: |
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.
LGTM modulo one test/TODO
@@ -537,5 +537,11 @@ TEST_P(QuicHttpIntegrationTest, RequestResponseWithTrailers) { | |||
/*response_trailers_present=*/true); | |||
} | |||
|
|||
// Multiple 1xx before the request completes. | |||
TEST_P(QuicHttpIntegrationTest, EnvoyProxyingEarlyMultiple1xx) { |
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.
Think it's worth a test of the reset for 101 here, or want to TODO it for later?
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.
It is already unit tested and will be covered by protocol integration test once HTTP3 is added into the test.
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.
Sorry, I misunderstood the test for non-100 case. 101 response status is indeed a HTTP3 specific case. Added an integration test here.
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.
Works for me :-)
Signed-off-by: Dan Zhang <[email protected]>
Sorry for reverting my previous response, I added an e2e test intead. Mind taking another look? |
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.
Even better, thanks!
Can this PR be merged now? |
Signed-off-by: Dan Zhang [email protected]
Commit Message: Add 100 continue support to envoy_quic_client_stream. Fix some quic stream and stream decoder interaction issues.
Additional Description: issues fixed:
Following StreamDecoder callbacks shouldn't be called if decodeHeaders|Data|Traiers() causes stream is reset or connection close.
decodeHeaders|Data|Traiers() shouldn't be called if quic header/trailers are too large.
StreamCallback::onResetStream() shouldn't be called if end_stream is decoded.
Risk Level: low, not in use
Testing: Added more stream unit tests and an e2e test
Part of #2557