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

v2.0: Remove explicit stream finish (backport of #2760) #2766

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Aug 28, 2024

Problem

stream finish is redundant as StreamDrop is already doing that.
Removing that will allow next call to be made faster without waiting for the stream to be finished.

Summary of Changes

removed explicit stream finish

Fixes #


This is an automatic backport of pull request #2760 done by [Mergify](https://mergify.com).

* remove finish as it is redaundant to stream drop

* remove finish as it is redaundant to stream drop

(cherry picked from commit 61d6a22)
@mergify mergify bot requested a review from a team as a code owner August 28, 2024 16:22
@alessandrod
Copy link

I want to backport this because it makes a big difference when sending txs over the internet (RTT not close to 0). Before the patch we were essentially serializing all tx writes, waiting for the server to ack one by one. Testing on a connection from US to korea, removing this line makes the difference between sending < 10 TPS to sending tens of thousands TPS.

The patch is safe, dropping the stream calls finish() internally anyway: https://github.com/quinn-rs/quinn/blob/3bd6f93a284a57ce551ddf2e77bb4233d568a34e/quinn/src/send_stream.rs#L276

Since QUIC guarantees delivery, even not calling finish we still get guaranteed delivery, from https://github.com/quinn-rs/quinn/blob/3bd6f93a284a57ce551ddf2e77bb4233d568a34e/quinn/src/send_stream.rs#L18

/// A stream that can only be used to send data
///
/// If dropped, streams that haven't been explicitly [`reset()`] will continue to (re)transmit
/// previously written data until it has been fully acknowledged or the connection is closed.

tldr: the patch is a big improvement and comes with no risk.

Copy link

@t-nelson t-nelson left a comment

Choose a reason for hiding this comment

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

we like the red lines

@alessandrod alessandrod merged commit 81c310a into v2.0 Sep 8, 2024
38 checks passed
@alessandrod alessandrod deleted the mergify/bp/v2.0/pr-2760 branch September 8, 2024 15:53
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.

3 participants