Skip to content

http2: deflake WindowUpdateAfterLargeResponseRealisticClient - #48790

Merged
botengyao merged 1 commit into
envoyproxy:mainfrom
derekargueta:dargueta-deflake-http2-flood-window-update
Oct 30, 2026
Merged

botengyao merged 1 commit into
envoyproxy:mainfrom
derekargueta:dargueta-deflake-http2-flood-window-update

Conversation

@derekargueta

@derekargueta derekargueta commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

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

The test opens the client's window once upstream_rq_completed reaches 1,
expecting the whole 1 MiB body to be buffered in the downstream codec by
then. The router charges that counter on the upstream response headers,
not the end of the body, so the window could open while the body was still
streaming in. Envoy then sends what is pending as one frame and each later
upstream chunk as its own, and the test saw 42, 50 or 64 DATA frames where
it expected one.

Wait on http2.pending_send_bytes reaching the body size instead. Capping
oghttp2 DATA frames at 16 KiB (envoyproxy#48514) made the count come out at 64 either
way, which hid the race on the default path; the branch with
http2_oghttp2_cap_data_frame_payload disabled still asserts a single frame.

Signed-off-by: Derek Argueta <[email protected]>
@repokitteh-read-only

Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #48790 was opened by derekargueta.

see: more, trace.

@derekargueta
derekargueta marked this pull request as ready for review October 28, 2026 05:39
@botengyao
botengyao merged commit 73f342d into envoyproxy:main Oct 30, 2026
27 checks passed
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants