Repository navigation
Add runtime flag to cap oghttp2 outbound DATA frame payloads at 16 KiB. - #48514
Merged
Merged
Conversation
RyanTheOptimist
previously approved these changes
Oct 21, 2026
Signed-off-by: Prateek Jain <[email protected]>
prateekdceit06
force-pushed
the
window-update-oghttp2
branch
from
October 21, 2026 21:22
e53f6bb to
6884374
Compare
Contributor
Author
|
/retest |
Contributor
|
Runtime features are removed after 6 months. Will this bug come back after that? /wait-any |
Contributor
@yanavlasov If, when the guard is removed, the code it guarded is also removed then yes the bug would come back but I assume that |
reubent-goog
approved these changes
Oct 23, 2026
yanavlasov
approved these changes
Oct 23, 2026
botengyao
pushed a commit
that referenced
this pull request
Oct 30, 2026
Commit Message: http2: deflake WindowUpdateAfterLargeResponseRealisticClient The test opens the client's window once `upstream_rq_completed` reaches 1, on the assumption that the whole 1 MiB body is buffered in the downstream codec by then. The router charges that counter on the upstream response headers, not at the end of the body, so the window could open while the body was still streaming in. Envoy then sends whatever is pending as one frame and each later upstream chunk as its own, and CI saw 42, 50 or 64 DATA frames where the oghttp2 branch expects 1. This waits for `http2.pending_send_bytes` to reach the body size instead. #48514's 16 KiB cap made the count come out at 64 either way, which hid the race on the default path, but the branch with `http2_oghttp2_cap_data_frame_payload` disabled still asserts a single frame. Additional Description: It failed on 10 changes between 10-11 and 10-23, on msan and tsan, always at the `data_frames` check. It hasn't failed since #48514 landed, because no CI job runs with the cap disabled, so this fixes the wait rather than a flake CI can still hit. To reproduce, I had the autonomous upstream send the 1 MiB body 500ms after the headers, from another thread, with the cap disabled. With the old wait, `pending_send_bytes` was 0 when the wait returned and oghttp2 sent 64 frames, failing every run. With the new wait the test waits out the delay, gets 1 frame, and passes 12/12. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - delayed-body repro above, cap disabled: fails on both oghttp2 params before, 12/12 pass after - `bazel test //test/integration:http2_flood_integration_test --runs_per_test=5`: pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]>
phlax
pushed a commit
to phlax/envoy
that referenced
this pull request
Nov 12, 2026
…oxy#48790) Commit Message: http2: deflake WindowUpdateAfterLargeResponseRealisticClient The test opens the client's window once `upstream_rq_completed` reaches 1, on the assumption that the whole 1 MiB body is buffered in the downstream codec by then. The router charges that counter on the upstream response headers, not at the end of the body, so the window could open while the body was still streaming in. Envoy then sends whatever is pending as one frame and each later upstream chunk as its own, and CI saw 42, 50 or 64 DATA frames where the oghttp2 branch expects 1. This waits for `http2.pending_send_bytes` to reach the body size instead. envoyproxy#48514's 16 KiB cap made the count come out at 64 either way, which hid the race on the default path, but the branch with `http2_oghttp2_cap_data_frame_payload` disabled still asserts a single frame. Additional Description: It failed on 10 changes between 10-11 and 10-23, on msan and tsan, always at the `data_frames` check. It hasn't failed since envoyproxy#48514 landed, because no CI job runs with the cap disabled, so this fixes the wait rather than a flake CI can still hit. To reproduce, I had the autonomous upstream send the 1 MiB body 500ms after the headers, from another thread, with the cap disabled. With the old wait, `pending_send_bytes` was 0 when the wait returned and oghttp2 sent 64 frames, failing every run. With the new wait the test waits out the delay, gets 1 frame, and passes 12/12. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - delayed-body repro above, cap disabled: fails on both oghttp2 params before, 12/12 pass after - `bazel test //test/integration:http2_flood_integration_test --runs_per_test=5`: pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
jwendell
pushed a commit
that referenced
this pull request
Nov 12, 2026
Commit Message: http2: deflake WindowUpdateAfterLargeResponseRealisticClient The test opens the client's window once `upstream_rq_completed` reaches 1, on the assumption that the whole 1 MiB body is buffered in the downstream codec by then. The router charges that counter on the upstream response headers, not at the end of the body, so the window could open while the body was still streaming in. Envoy then sends whatever is pending as one frame and each later upstream chunk as its own, and CI saw 42, 50 or 64 DATA frames where the oghttp2 branch expects 1. This waits for `http2.pending_send_bytes` to reach the body size instead. #48514's 16 KiB cap made the count come out at 64 either way, which hid the race on the default path, but the branch with `http2_oghttp2_cap_data_frame_payload` disabled still asserts a single frame. Additional Description: It failed on 10 changes between 10-11 and 10-23, on msan and tsan, always at the `data_frames` check. It hasn't failed since #48514 landed, because no CI job runs with the cap disabled, so this fixes the wait rather than a flake CI can still hit. To reproduce, I had the autonomous upstream send the 1 MiB body 500ms after the headers, from another thread, with the cap disabled. With the old wait, `pending_send_bytes` was 0 when the wait returned and oghttp2 sent 64 frames, failing every run. With the new wait the test waits out the delay, gets 1 frame, and passes 12/12. AI Disclaimer: code change created with AI assistance, fully reviewed by me prior to opening. Risk Level: Low (test only) Testing: - delayed-body repro above, cap disabled: fails on both oghttp2 params before, 12/12 pass after - `bazel test //test/integration:http2_flood_integration_test --runs_per_test=5`: pass (macOS arm64, fastbuild) Docs Changes: N/A Release Notes: N/A Platform Specific Features: N/A Signed-off-by: Derek Argueta <[email protected]> Signed-off-by: Ryan Northey <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Commit Message:
http2: cap oghttp2 outbound DATA frames at 16 KiB to match nghttp2 to avoidWINDOW_UPDATEframe floodAdditional Description:
When a client advertises a large
SETTINGS_MAX_FRAME_SIZE, oghttp2 sizes outbound DATA frames up to that limit, while nghttp2 always caps DATA payloads at 16 KiB (NGHTTP2_DATA_PAYLOADLEN). Envoy'sWINDOW_UPDATEflood protection (ProtocolConstraints) budgets inboundWINDOW_UPDATEframes as5 + 2 * (streams + 10 * outbound_data_frames), so a well-behaved client that acknowledges a large response in small increments receives far fewer DATA frames under oghttp2, exceeds the budget, and is disconnected withhttp2.inbound_window_update_frames_flood.This change sets the new QUICHE option
OgHttp2Session::Options::max_outbound_data_frame_payloadto 16 KiB whenenvoy.reloadable_features.http2_oghttp2_cap_data_frame_payloadis enabled, so oghttp2 produces the same DATA framing as nghttp2 and the window update flood behavior is identical under both codecs. Only affects connections using oghttp2 (envoy.reloadable_features.http2_use_oghttp2); nghttp2 behaviour is unchanged. Requires the QUICHE roll to 9e60ac2 (#48104), which addsOgHttp2Session::Options::max_outbound_data_frame_payload.Risk Level: Low. Only changes how
oghttp2fragments response bodies into DATA frames (never larger than the RFC 9113 default frame size); no wire-protocol or API change. Guarded by a runtime flag.Testing:
Http2FloodMitigationTest.WindowUpdateAfterLargeResponseRealisticClient: with the runtime guard enabled (the default) oghttp2 now sends 64 x 16 KiB DATA frames for a 1 MiB response, no WINDOW_UPDATE flood is detected, and the connection accepts a subsequent request -- identical tonghttp2.Docs Changes: N/A
Release Notes:
behavior_changes:
change: |
When using oghttp2 (
envoy.reloadable_features.http2_use_oghttp2), outbound DATA frame payloads are now capped at 16 KiB regardless of the peer'sSETTINGS_MAX_FRAME_SIZE, matching nghttp2. This prevents legitimate flow-controlWINDOW_UPDATEtraffic from being misclassified as a flood (http2.inbound_window_update_frames_flood). This behavior can be reverted by setting the runtime guardenvoy.reloadable_features.http2_oghttp2_cap_data_frame_payloadto false.Platform Specific Features: N/A
[Optional Runtime guard:] envoy.reloadable_features.http2_oghttp2_cap_data_frame_payload
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]