Skip to content

Honor TCP_USER_TIMEOUT after reaching the keepalive probe count - #16905

Open
tamird wants to merge 1 commit into
google:masterfrom
tamird:proposal/tcp-keepalive-user-timeout
Open

tamird wants to merge 1 commit into
google:masterfrom
tamird:proposal/tcp-keepalive-user-timeout

Conversation

@tamird

@tamird tamird commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

A socket with TCP_KEEPCNT set to one can close after its first
unanswered keepalive probe even when the application has asked TCP to
wait longer. Linux uses the user timeout to decide when to close such
a socket 1.

Use the probe count only when TCP_USER_TIMEOUT is zero. Exercise both
configurations on the wire with an idle peer that never answers probes.

A socket with TCP_KEEPCNT set to one can close after its first
unanswered keepalive probe even when the application has asked TCP to
wait longer. Linux uses the user timeout to decide when to close such
a socket [1].

Use the probe count only when TCP_USER_TIMEOUT is zero. Exercise both
configurations on the wire with an idle peer that never answers probes.

[1] https://github.com/torvalds/linux/blob/7d0a66e4b/net/ipv4/tcp_timer.c#L825-L839
@tamird

tamird commented Nov 10, 2026

Copy link
Copy Markdown
Contributor Author

@carzh, could you review the changes to pkg/tcpip/transport/tcp/connect.go in this PR? You worked on this file in #15019.

Posted by Codex on behalf of @tamird.

@tamird

tamird commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

@kerumeto, could you review the changes to pkg/tcpip/transport/tcp/ in this PR? You worked in this directory in #14458.

Posted by Codex on behalf of @tamird.

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.

1 participant