Repository navigation
device,cmd/check-lockorder: fix race on reading peer.deleteOnIdle - #108
Merged
Merged
Conversation
illotum
requested review from
a team,
cmol,
creachadair,
danderson and
jwhited
October 1, 2026 23:27
sfllaw
approved these changes
Oct 2, 2026
creachadair
approved these changes
Oct 2, 2026
cmol
approved these changes
Oct 2, 2026
cmol
left a comment
There was a problem hiding this comment.
Can you add something to the commit message on why some things are moving from device to peer?
deleteOnIdle is a read-only field after Start() and is accessed concurrently without locking. Except it is publshed to a shared registry before Start() is called, leading to a race condition. Extend this contract to make it read-write only until published. Port all other configuration to happen before publishing as well. One call-site that configures it after publishing, via a UAPI call, remains safe because of the global lock held by the NewPeer caller. Also update cmd/check-lockorder to parse deferred unlocks and register AllowedIPs.mu in the graph. Fixes tailscale/corp#48142 Signed-off-by: Alex Valiushko <alexvaliushko@tailscale.com> Change-Id: I239b62657ec4a666cb50402ba2420a656a6a6964
illotum
force-pushed
the
illotum/lazypeer-race
branch
from
October 2, 2026 16:20
11137ed to
a3423f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
deleteOnIdle is a read-only field after Start() and is accessed concurrently without locking. Except it is publshed to a shared registry before Start() is called, leading to a race condition.
Extend this contract to make it read-write only until published. Port all other configuration to happen before publishing as well.
One call-site that configures it after publishing, via a UAPI call, remains safe because of the global lock held by the NewPeer caller.
Also update cmd/check-lockorder to parse deferred unlocks and register AllowedIPs.mu in the graph.
Fixes tailscale/corp#48142
Change-Id: I239b62657ec4a666cb50402ba2420a656a6a6964