From f7da8c77bd14b0d018caa0a47f35a42a4ab950ea Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 11 Nov 2021 08:12:45 -0800 Subject: [PATCH] tstest/integration/testcontrol: fix data race Fix race from 1ec99e99f4e701fa1b9edef9eb0fbe022c5efebd Fixes #3289 Change-Id: I58158d3f82339ac171fb14827c5f158d602327f4 Signed-off-by: Brad Fitzpatrick --- tstest/integration/testcontrol/testcontrol.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tstest/integration/testcontrol/testcontrol.go b/tstest/integration/testcontrol/testcontrol.go index b5a8f5c46..77f237089 100644 --- a/tstest/integration/testcontrol/testcontrol.go +++ b/tstest/integration/testcontrol/testcontrol.go @@ -157,10 +157,11 @@ func (s *Server) AddPingRequest(nodeKeyDst key.NodePublic, pr *tailcfg.PingReque // Mark the Node key of every node as expired func (s *Server) SetExpireAllNodes(expired bool) { s.mu.Lock() + defer s.mu.Unlock() + s.allExpired = expired - s.mu.Unlock() - for _, node := range s.AllNodes() { + for _, node := range s.nodes { sendUpdate(s.updates[node.ID], updateSelfChanged) } }