-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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: use max header size configured in HCM #15912
Conversation
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
/retest |
Retrying Azure Pipelines: |
@snowp want me to take this one back? |
@alyssawilk Sure, go for it :) |
Signed-off-by: Dan Zhang <[email protected]>
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.
Cool, looking good.
I do think we should up the risk level to medium given the client connect() change.
@@ -5,11 +5,14 @@ | |||
#include "envoy/event/dispatcher.h" | |||
#include "envoy/network/connection.h" | |||
|
|||
#define QUICHE_INCLUDE_1 "quiche/quic/core/quic_connection.h" |
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.
What's this all about? Can we have macro comments?
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.
This is to avoid having duplicated #pragma GCC diagnostic...
block in files includes QUICHE files. The block is moved to source/common/quic/quic_includes_ignores.h which only needs to be included at the end of the #include
section. #define QUICHE_INCLUDE_1/2/...N
is used in place of #include
before each QUICHE header files.
Commented about its usage.
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.
Do we have a plan to get rid of these? cc @DavidSchinazi yak shaver extrordinare
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.
What's the goal of this macro? What's wrong with having duplicated pragmas?
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.
Do we have a plan to get rid of these? cc @DavidSchinazi yak shaver extrordinare
AFAIK, -Winvalid-offsetof will persist because it is caused by a QUIC frame memory optimization.
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.
What's the goal of this macro? What's wrong with having duplicated pragmas?
These pragmas are repeated in many files. And adding/removing a compiler option requires changing all the places. The goal of quic_includes_ignores.h is to avoid the duplication to improve both readability and maintainability. Though the macros are written in a very native way due to my limited preprocessor skill.
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.
2 things:
- QUICHE_INCLUDE_1 is the only one of these that is used. We probably don't need 2 to 5
- The header include that needs the pragma seems to be only quiche/quic/core/quic_connection.h; can we add a wrapper header with appropriate pragmas and have that include be the one that is included through the rest of Envoy code? Or have these pragmas added to quiche/quic/core/quic_connection.h via a quiche patch that Envoy adds while fetching the quiche dependency via bazel?
The best course of action would be to fix QUICHE. Until then, I guess duplicate pragmas are 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.
- QUICHE_INCLUDE_1 is the only one of these that is used. We probably don't need 2 to 5
The plan is to use QUICHE_INCLUDE_X in other files as well, they includes more QUICHE files which also needs the pragma diagnose ignore.
- The header include that needs the pragma seems to be only quiche/quic/core/quic_connection.h; can we add a wrapper header with appropriate pragmas and have that include be the one that is included through the rest of Envoy code? Or have these pragmas added to quiche/quic/core/quic_connection.h via a quiche patch that Envoy adds while fetching the quiche dependency via bazel?
quic_connection.h is not the only one that needs the pragma, but most of them.
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.
I see what you're trying to do. I'd say just use the pragmas directly in places that need them for now (and remove quic_includes_ignores.h), and I can take an action item to fix QUICHE. The correct fix here is to make QUICHE build without warnings, not to disable them in Envoy.
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.
SG.
Signed-off-by: Dan Zhang <[email protected]>
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 looks like this needs a main merge as well?
@@ -5,11 +5,14 @@ | |||
#include "envoy/event/dispatcher.h" | |||
#include "envoy/network/connection.h" | |||
|
|||
#define QUICHE_INCLUDE_1 "quiche/quic/core/quic_connection.h" |
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.
Do we have a plan to get rid of these? cc @DavidSchinazi yak shaver extrordinare
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
/retest |
Retrying Azure Pipelines: |
Signed-off-by: Dan Zhang <[email protected]>
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.
Looks great - almost there!
// Already detached from quic connection. | ||
return; | ||
} | ||
if (!initialized_) { |
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.
Can we get here? I thought quicConnection would return null above if not initialized.
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.
Good point! We need to distinguish between already closed and not initialized. In latter case, we need to retain close type and close in OnCanWrite().
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
Signed-off-by: Dan Zhang <[email protected]>
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, assuming we're going to debug the re-excluded tests in follow-ups :-)
Commit Message: use max header size in HCM config to initialize quic session. Additional Description: change QuicSession::Initialize() and filter chain creation order to set max header list size for each session before Initialize(). Move Initialize() of Http3 connection from CodecClient to CodecClientProd. Added CodecClient::connect() interface. Change EnvoyQuicConnection not to directly inherit from QuicConnection. And renamed it. Fix a use-after-free bug in FakeUpstream which causes ASAN failure. Risk Level: low Testing: more protocol H3 tests Part of envoyproxy#2557 envoyproxy#12930 envoyproxy#14829 Signed-off-by: Dan Zhang <[email protected]> Signed-off-by: Gokul Nair <[email protected]>
Commit Message: use max header size in HCM config to initialize quic session. Additional Description: change QuicSession::Initialize() and filter chain creation order to set max header list size for each session before Initialize(). Move Initialize() of Http3 connection from CodecClient to CodecClientProd. Added CodecClient::connect() interface. Change EnvoyQuicConnection not to directly inherit from QuicConnection. And renamed it. Fix a use-after-free bug in FakeUpstream which causes ASAN failure. Risk Level: low Testing: more protocol H3 tests Part of envoyproxy#2557 envoyproxy#12930 envoyproxy#14829 Signed-off-by: Dan Zhang <[email protected]> Signed-off-by: Gokul Nair <[email protected]>
Commit Message: use max header size in HCM config to initialize quic session.
Additional Description:
change QuicSession::Initialize() and filter chain creation order to set max header list size for each session before Initialize(). Move Initialize() of Http3 connection from CodecClient to CodecClientProd.
Added CodecClient::connect() interface.
Change EnvoyQuicConnection not to directly inherit from QuicConnection. And renamed it.
Fix a use-after-free bug in FakeUpstream which causes ASAN failure.
Risk Level: low
Testing: more protocol H3 tests
Part of #2557 #12930 #14829