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

discard DATAGRAM frames that don't fit into packets without an ACK #4221

Merged
merged 1 commit into from
Jan 1, 2024

Conversation

marten-seemann
Copy link
Member

Fixes #4144. Closes #4145.

This PR implements part of my suggestion in #4145 (comment).

If the packet doesn't contain an ACK (i.e. the payload is empty), there's no point retrying to pack it later. It's extremely unlikely that the available packet size will suddenly increase.

Since we're relaxing the API guarantees (SendDatagram doesn't guarantee that the DATAGRAM frame is actually going to be sent out), this PR should allow us to move away from the blocking API (datagramQueue.AddAndWait) that's the main cause for the bad datagram performance (#3766).

@joliveirinha @chungthuang @birneee Could you take a look at this PR please? Does this resolve your problem?

If the packet doesn't contain an ACK (i.e. the payload is empty),
there's no point retrying to pack it later. It's extremely unlikely that
the available packet size will suddenly increase.
@marten-seemann marten-seemann added this to the v0.41 milestone Dec 29, 2023
Copy link

codecov bot commented Dec 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d6e3f32) 83.95% compared to head (64c3f57) 83.98%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4221      +/-   ##
==========================================
+ Coverage   83.95%   83.98%   +0.02%     
==========================================
  Files         149      149              
  Lines       15405    15410       +5     
==========================================
+ Hits        12933    12941       +8     
+ Misses       1973     1971       -2     
+ Partials      499      498       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@chungthuang
Copy link
Contributor

Thank you @marten-seemann. This fixes the blocking problem we are seeing.

@marten-seemann
Copy link
Member Author

Thanks for reviewing @chungthuang!

@marten-seemann marten-seemann merged commit 7f080dd into master Jan 1, 2024
34 checks passed
@marten-seemann marten-seemann deleted the discard-too-large-datagrams branch January 1, 2024 04:00
@joliveirinha
Copy link
Contributor

Thank you @marten-seemann for the fix.

nanokatze pushed a commit to nanokatze/quic-go that referenced this pull request Feb 1, 2024
…uic-go#4221)

If the packet doesn't contain an ACK (i.e. the payload is empty),
there's no point retrying to pack it later. It's extremely unlikely that
the available packet size will suddenly increase.
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.

Prevent large datagrams from blocking the send queue
3 participants