mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-23 17:18:42 +00:00
ipn/ipnlocal: fix race condition that results in a panic sending on a closed channel
Fixes #13288 Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
@@ -251,6 +251,14 @@ func TestServeConfigForeground(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
// Introduce a race between [LocalBackend] sending notifications
|
||||
// and [LocalBackend.WatchNotifications] shutting down due to
|
||||
// setting the serve config below.
|
||||
const N = 1000
|
||||
for range N {
|
||||
go b.send(ipn.Notify{})
|
||||
}
|
||||
|
||||
// Setting a new serve config should shut down WatchNotifications
|
||||
// whose session IDs are no longer found: session1 goes, session2 stays.
|
||||
err = b.SetServeConfig(&ipn.ServeConfig{
|
||||
|
Reference in New Issue
Block a user