From 3fb852e9da834aa68b8d733f68b1f18856bf38f2 Mon Sep 17 00:00:00 2001 From: Paul Wells Date: Mon, 15 Apr 2024 17:37:21 -0700 Subject: [PATCH] Handle timer stop race in agent connectivity check loop --- agent.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/agent.go b/agent.go index 84f7b427..e329e247 100644 --- a/agent.go +++ b/agent.go @@ -400,7 +400,9 @@ func (a *Agent) connectivityChecks() { select { case <-a.forceCandidateContact: - t.Stop() + if !t.Stop() { + <-t.C + } contact() case <-t.C: contact()