-
Notifications
You must be signed in to change notification settings - Fork 5.5k
[http] Initial codec splitting with test parametrization #10591
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
Changes from 57 commits
a24ecb3
8a80bb9
53d5d22
3084c49
11d7da4
8eadbf1
321985a
a25c204
4ff37a6
65ecdd9
c6714f9
86416d4
c0967d3
41cbed2
fc497e8
6f5b4dd
e57e759
2d7cebe
44b80d9
32da690
22e9e21
d0b7f79
1b3262b
14aad1f
18432dd
4be1184
23507ff
7987381
efa71af
5a38663
e036bc8
b790c38
486ef19
220d33a
5c0fb12
43a7cc4
7cc9497
2506ab2
1e1a884
d6e7571
8bc999a
e0c6183
2c3153d
2ae285e
632758e
0bd9774
de11d7a
33708be
2049662
d7ea2ac
9d75493
e6aaf3a
2e2514d
e9be89a
071d2f7
f5eff5e
3b550a7
3eeb952
f7f14c7
0a65360
7c5484d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,7 +11,9 @@ | |
| #include "common/http/header_utility.h" | ||
| #include "common/http/headers.h" | ||
| #include "common/http/http1/codec_impl.h" | ||
| #include "common/http/http1/codec_impl_legacy.h" | ||
| #include "common/http/http2/codec_impl.h" | ||
| #include "common/http/http2/codec_impl_legacy.h" | ||
| #include "common/http/path_utility.h" | ||
| #include "common/http/utility.h" | ||
| #include "common/network/utility.h" | ||
|
|
@@ -51,14 +53,26 @@ ServerConnectionPtr ConnectionManagerUtility::autoCreateCodec( | |
| headers_with_underscores_action) { | ||
| if (determineNextProtocol(connection, data) == Utility::AlpnNames::get().Http2) { | ||
| Http2::CodecStats& stats = Http2::CodecStats::atomicGet(http2_codec_stats, scope); | ||
| return std::make_unique<Http2::ServerConnectionImpl>( | ||
| connection, callbacks, stats, http2_options, max_request_headers_kb, | ||
| max_request_headers_count, headers_with_underscores_action); | ||
| if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.new_codec_behavior")) { | ||
| return std::make_unique<Http2::ServerConnectionImpl>( | ||
| connection, callbacks, stats, http2_options, max_request_headers_kb, | ||
| max_request_headers_count, headers_with_underscores_action); | ||
| } else { | ||
| return std::make_unique<Legacy::Http2::ServerConnectionImpl>( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question - given the overhead we're going to have for edits during this period, would it make sense to tackle these one at a time? I don't know how long you estimate the work on each codec to be - if it's a week or so it's not worth splitting, but if it's going to be a month on HTTP/1 it'd be nice to not incur extra work on HTTP/2 during that time period. What are your thoughts here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @yanavlasov Possibly. I only just finished merging edits in source files and tests for both codecs and parametrizing the H/1 codec unit test so it's easier to spot when it's out of sync. For H/2: It's very messy to parametrize the H/2 codec because it uses another test class. If we're okay not parametrizing the H/2 codec_impl_test and relying on just diffing the test files for the two H/2 codec implementation in fix_format (working on right now), then the H/2 work is done as well. Otherwise if we really want to parametrize the H/2 codec_impl test like I did for H/1 I'll split this out.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. Yes parameterizing H/2 codec test would be quite a bit of surgery. I think it would be very good to have H/2 test parameterized and I'm going to see if it can be done reasonably easy. It is probably not a blocker for this PR.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thinking more about this, I think the way it is done now it totally fine for this PR. We have coverage for both H/2 codecs through separate tests. Yes, it is more overhead and a bit inconvenient. Note however that test files are exactly the same with the exception of the namespace declaration, so it should just be cut and paste of the test. |
||
| connection, callbacks, stats, http2_options, max_request_headers_kb, | ||
| max_request_headers_count, headers_with_underscores_action); | ||
| } | ||
| } else { | ||
| Http1::CodecStats& stats = Http1::CodecStats::atomicGet(http1_codec_stats, scope); | ||
| return std::make_unique<Http1::ServerConnectionImpl>( | ||
| connection, stats, callbacks, http1_settings, max_request_headers_kb, | ||
| max_request_headers_count, headers_with_underscores_action); | ||
| if (Runtime::runtimeFeatureEnabled("envoy.reloadable_features.new_codec_behavior")) { | ||
| return std::make_unique<Http1::ServerConnectionImpl>( | ||
| connection, stats, callbacks, http1_settings, max_request_headers_kb, | ||
| max_request_headers_count, headers_with_underscores_action); | ||
| } else { | ||
| return std::make_unique<Legacy::Http1::ServerConnectionImpl>( | ||
| connection, stats, callbacks, http1_settings, max_request_headers_kb, | ||
| max_request_headers_count, headers_with_underscores_action); | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.