Skip to content

refactor: better auto default for data frame budget - #946

Merged
seanmonstar merged 1 commit into
masterfrom
sean/orvlpvnqoqqq
Aug 24, 2026
Merged

refactor: better auto default for data frame budget#946
seanmonstar merged 1 commit into
masterfrom
sean/orvlpvnqoqqq

Conversation

@seanmonstar

Copy link
Copy Markdown
Member

Instead of choosing a specific small default constant, the small data frame overhead budget will now be calculated based on the configured connection window size. Setting the budget directly will skip the default auto value.

Closes #944

@Sruhvx-jpg

Sruhvx-jpg commented Aug 23, 2026

Copy link
Copy Markdown

Small nit on resolve:
we can avoid bouncing through u64 with (window as usize / 2).max(DEFAULT_DATA_FRAME_BUDGET).

Also as a naive proposal, window >> 1 could be used instead of / 2.

Sruhvx-jpg added a commit to Sruhvx-jpg/h2 that referenced this pull request Aug 23, 2026
Problem

HTTP/2 flow control limits DATA payload bytes, but not the framing overhead
from excessive numbers of small frames. A peer could fragment data into many
tiny frames, causing disproportionate memory usage from queued events while
remaining within flow-control windows.

Solution

Backport the framing overhead budget and empty frame handling from master
(hyperium#935, hyperium#940, hyperium#942, hyperium#945, hyperium#946) to the 0.3.x maintenance branch.

Validation

Ran the full test suite and added regression integration tests in stream_states.rs.
Instead of choosing a specific small default constant, the small data frame
overhead budget will now be calculated based on the configured connection
window size. Setting the budget directly will skip the default auto value.
@seanmonstar
seanmonstar merged commit c7e89e9 into master Aug 24, 2026
6 checks passed
@seanmonstar
seanmonstar deleted the sean/orvlpvnqoqqq branch August 24, 2026 12:15
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.

h2 fix for the recent security vulnerability breaks downstream consumers

2 participants