From 383f21559eb57304079df77467ec48481a499a1b Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 18 Apr 2017 16:36:20 -0700 Subject: [PATCH] Explain weird timer logic --- command/agent/consul/client.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/command/agent/consul/client.go b/command/agent/consul/client.go index 3d3b4027c..7f0a9a732 100644 --- a/command/agent/consul/client.go +++ b/command/agent/consul/client.go @@ -155,6 +155,9 @@ func (c *ServiceClient) Run() { } failures++ if !retryTimer.Stop() { + // Timer already expired, since the timer may + // or may not have been read in the select{} + // above, conditionally receive on it select { case <-retryTimer.C: default: