fix: preserve connection task coalescing#920
Closed
brentechols wants to merge 3 commits into
Closed
Conversation
28d5e03 to
4b63ca9
Compare
Member
|
Welp, I caused a bunch of annoying conflicts, so I just cherry-picked in your commit instead of resolving them in this Github PR, pushed now to original branch/PR. |
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.
This is stacked on top of #917.
Problem
In #917,
Inner::poll_completeregisters the connection task waker before draining pending stream operations. That lets stream handles wake the connection task while it is still actively polling the current batch of work. For receive-side capacity releases, this changes the old batching boundary from main: instead of accumulating releases until the current poll has drained, the connection can be woken repeatedly and emit smaller, more frequentWINDOW_UPDATEframes.In the reproducer this showed up most clearly with one TCP connection, default flow-control windows, and multiple concurrent streams. Base #917 sent roughly twice as many connection-level
WINDOW_UPDATEframes as main/fixed, with about half the average update size.Solution
Delay
shared.conn_task.register(cx.waker())until after recv/send pending work has been drained, matching the old single-waker coalescing boundary. The pending paths still register the waker before returningPoll::Pending, so transport wakeups are not missed.Validation
Focused test suite:
Benchmark configuration:
Single-run Windows loopback results:
The fix removes the severe one-connection cliff and returns the slowest #917 cases to roughly main-level throughput.