Skip to content

Conversation

@ethanndickson
Copy link
Member

@ethanndickson ethanndickson commented Aug 7, 2024

Fixes #14143.
Fixes a race condition that can occur when a tailnet connection is closed just before a network telemetry event is about to be sent off. Specifically, where waitgroup.Add(n) is called on a waitgroup where waitgroup.Wait() is currently blocking another goroutine.

This works as we only call Wait() on the telemetryWg waitgroup when the Conn mutex is held, and only after the closed channel has been closed. We then require that the goroutine sending the telemetry event acquire said mutex, and that the channel is not closed, before adding to the waitgroup and sending the event.

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @ethanndickson and the rest of your teammates on Graphite Graphite

@ethanndickson ethanndickson marked this pull request as ready for review August 7, 2024 05:49
@ethanndickson ethanndickson merged commit e09ad1d into main Aug 7, 2024
@ethanndickson ethanndickson deleted the 08-07-fix_lock_adding_to_tailnet_waitgroup_to_avoid_race_and_fix_flake_ branch August 7, 2024 05:52
@github-actions github-actions bot locked and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flake: TestSSH/RemoteForward

3 participants