Skip to content

tailcat: make Server.Close and Client.Close idempotent - #9

Closed
awdemos wants to merge 1 commit into
tailscale:mainfrom
awdemos:fix-double-close
Closed

tailcat: make Server.Close and Client.Close idempotent#9
awdemos wants to merge 1 commit into
tailscale:mainfrom
awdemos:fix-double-close

Conversation

@awdemos

@awdemos awdemos commented Aug 27, 2026

Copy link
Copy Markdown

Close on either side could be called more than once, especially from multiple cleanup paths. The underlying Engine.Close and NetMon.Close are not documented as safe to call repeatedly, so a second Close could panic or return an error. Guard both with a sync.Once so the second and subsequent calls are harmless no-ops.

Add TestDoubleClose to verify that repeated Close calls on a started Server and Client do not fail.

Close on either side could be called more than once, especially from
multiple cleanup paths. The underlying Engine.Close and NetMon.Close
are not documented as safe to call repeatedly, so a second Close could
panic or return an error. Guard both with a sync.Once so the second
and subsequent calls are harmless no-ops.

Add TestDoubleClose to verify that repeated Close calls on a started
Server and Client do not fail.

Updates tailscale/tailcat (adversarial audit).
@bradfitz

Copy link
Copy Markdown
Member

Your new TestDoubleClose passes without your tailcat.go change.

What is this actually fixing?

@bradfitz

Copy link
Copy Markdown
Member

You've burned my trust at this point sending a bunch of PRs that do nothing and have no tests (or have a test that already passed without your change) and don't have a corresponding issue or even a description of what the problem was.

So I'm going to close this.

If a human wants to tell me what the problem is, then we can fix it. We can even fix it with AI, but we need to know what we're fixing and verify it actually fixes it, first.

@bradfitz bradfitz closed this Aug 28, 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.

2 participants