Skip to content
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

Refactor receive stream buffering #758

Merged
merged 10 commits into from
May 29, 2020
Merged

Refactor receive stream buffering #758

merged 10 commits into from
May 29, 2020

Conversation

Ralith
Copy link
Collaborator

@Ralith Ralith commented May 9, 2020

Fixes #735. Should marginally improve performance for ordered reads due to isolation of the (now somewhat more) complex RangeSet operations to the unordered case where they're necessary, leaving simple cursor-based logic for ordered behavior.

@codecov
Copy link

codecov bot commented May 9, 2020

Codecov Report

Merging #758 into master will increase coverage by 0.21%.
The diff coverage is 92.40%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #758      +/-   ##
==========================================
+ Coverage   71.33%   71.55%   +0.21%     
==========================================
  Files          73       74       +1     
  Lines       13111    13277     +166     
==========================================
+ Hits         9353     9500     +147     
- Misses       3758     3777      +19     
Impacted Files Coverage Δ
quinn/src/streams.rs 67.59% <0.00%> (-0.81%) ⬇️
quinn/tests/many_connections.rs 0.00% <0.00%> (ø)
quinn-proto/src/connection/assembler.rs 96.13% <91.66%> (-1.46%) ⬇️
quinn-proto/src/connection/streams.rs 86.17% <93.33%> (-0.33%) ⬇️
quinn-proto/src/connection/mod.rs 79.28% <100.00%> (-0.86%) ⬇️
quinn-proto/src/range_set.rs 92.77% <100.00%> (+1.67%) ⬆️
quinn-h3/src/server.rs 66.40% <0.00%> (-0.53%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update de5dc88...f7c007a. Read the comment docs.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some early comments. Still chewing on the Assembler state splitting...

@djc
Copy link
Member

djc commented May 12, 2020

(Also very well-factored commits here. In terms of preventing unnecessary rebase efforts, maybe submit the first four commits separately so we can merge them immediately?)

@Ralith Ralith mentioned this pull request May 12, 2020
@Ralith
Copy link
Collaborator Author

Ralith commented May 12, 2020

Cherry-picked the simple stuff into #770.

@Ralith Ralith force-pushed the buffer-bounds branch 2 times, most recently from d993bd9 to cde86cb Compare May 13, 2020 06:55
@Ralith
Copy link
Collaborator Author

Ralith commented May 21, 2020

Rebased to account for #776. Will need another after #777 is merged, or vis versa.

@Ralith
Copy link
Collaborator Author

Ralith commented May 22, 2020

Rebased.

@Ralith Ralith force-pushed the buffer-bounds branch 2 times, most recently from 2389fbf to f4d5058 Compare May 24, 2020 02:05
@Ralith
Copy link
Collaborator Author

Ralith commented May 24, 2020

Got rid of a bunch of unnecessary complexity regarding is_fully_read, and found and fixed a significant bug in the process.

@Ralith Ralith force-pushed the buffer-bounds branch 2 times, most recently from 421a94e to a08e058 Compare May 24, 2020 04:42
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whew, I made it through. This is looking good (and definitely better than earlier). I think all of my comments are pretty cosmetic.

Ralith added 9 commits May 28, 2020 18:15
When there's a leading gap in the buffered data or unordered reads are
in use, `self.offset` does not represent the starting point of the
first chunk.
DataRecvd was used to identify when all data has been received but not
yet read by the application, but we can determine that on-demand in
the Recvd state.
Ensures we don't yield the same data to the application repeatedly,
and only issue flow control credit in response to new data.
This was probably unreachable as we dispose of closed receive streams
immediately after they become such, but if that ever changes we still
don't want to panic.
@djc
Copy link
Member

djc commented May 29, 2020

Nice work.

@djc djc closed this May 29, 2020
@djc djc reopened this May 29, 2020
@djc djc merged commit 333c3ac into master May 29, 2020
@delete-merged-branch delete-merged-branch bot deleted the buffer-bounds branch May 29, 2020 14:04
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.

read_unordered can issue redundant flow control credit
2 participants