Skip to content

checklocks: publish initialized TCP endpoint IDs - #14337

Closed
tamird wants to merge 1 commit into
google:masterfrom
tamird:checklocks-tcp-registration
Closed

checklocks: publish initialized TCP endpoint IDs#14337
tamird wants to merge 1 commit into
google:masterfrom
tamird:checklocks-tcp-registration

Conversation

@tamird

@tamird tamird commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

TCP ICMP errors read endpoint addresses and ports without taking the endpoint mutex since 62b4c2f. An active connection previously published its selected ephemeral tuple before assigning it to the endpoint, so an incoming error could race with that assignment or report a zero local port.

Assign the selected port before registering the endpoint and restore the old ID if registration fails. Taking the endpoint mutex in the ICMP reader would deadlock synchronous loopback errors during writes.

Extend the existing connect-error test to deliver a matching ICMP error as soon as the endpoint is registered. Pause the handshake clock before SYN allocation so later synchronization cannot hide the publication race.

Assisted-by: Codex

TCP ICMP errors read endpoint addresses and ports without taking the
endpoint mutex since 62b4c2f. An active connection previously
published its selected ephemeral tuple before assigning it to the
endpoint, so an incoming error could race with that assignment or report
a zero local port.

Assign the selected port before registering the endpoint and restore the
old ID if registration fails. Taking the endpoint mutex in the ICMP
reader would deadlock synchronous loopback errors during writes.

Extend the existing connect-error test to deliver a matching ICMP error
as soon as the endpoint is registered. Pause the handshake clock before
SYN allocation so later synchronization cannot hide the publication
race.

Assisted-by: Codex
@tamird

tamird commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

r? @nybidari Could you review initializing endpoint IDs before demux publication without ICMP re-entry deadlocks?

Focused local Bazel checks passed. Upstream checks have not reported yet.

cc @konstantin-s-bogom

Assisted-by: Codex

@tamird

tamird commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of consolidated #14338. The expanded replacement commits are prepared locally; the replacement branch has not been pushed yet.

Assisted-by: Codex

@tamird tamird closed this Aug 23, 2026
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