Skip to content

Stabilize tcp_deferaccept#154834

Open
JohnTitor wants to merge 1 commit intorust-lang:mainfrom
JohnTitor:stabilize-tcpdeferaccept
Open

Stabilize tcp_deferaccept#154834
JohnTitor wants to merge 1 commit intorust-lang:mainfrom
JohnTitor:stabilize-tcpdeferaccept

Conversation

@JohnTitor
Copy link
Copy Markdown
Member

@JohnTitor JohnTitor commented Apr 5, 2026

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Apr 5, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 5, 2026

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 8 candidates
  • Random selection from Mark-Simulacrum, jhpratt

@asquared31415
Copy link
Copy Markdown
Contributor

I think that the doc comments need editing for grammar and also to allow for cases where the Duration is used in a different way.

Additionally, the API requires passing a Duration, but the documentation says

Takes an integer value (seconds), this can bound the maximum number of attempts TCP will make to complete the connection.

In practice I believe that the special value 0 is equivalent to disabling the option and the duration is translated to a number of "retransmits" (capped at 255) so it may not be reliable. I don't believe that the current API is suitable, or if it is, it needs very heavy warnings.

@JohnTitor
Copy link
Copy Markdown
Member Author

It's intentionally Duration, see #119639 (comment) and #140482

@asquared31415
Copy link
Copy Markdown
Contributor

asquared31415 commented Apr 5, 2026

Another problem: the number of seconds passed also isn't a maximum either, it's a hint.

For example, if you pass 8 seconds to this API, that will get calculated as 4 retransmits, which will wait up to 15 seconds worth of retransmits. (as of linux kernel tag v6.18 (2025-11-30) which is what I have easily available at the moment)

This means that the duration can be significantly higher than the passed duration (up to 120 seconds longer in the most extreme cases I believe) or significantly lower (the duration is capped at 255 retransmits, which is about 29880 seconds or so if i'm doing the math correctly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tracking Issue for tcp_deferaccept

4 participants