From 1275bb24e59638e9d8e1bbfa9681c2bce80248aa Mon Sep 17 00:00:00 2001 From: Matthias Radestock Date: Sun, 12 Apr 2015 12:23:32 +0100 Subject: [PATCH] exclude stale info from ConnectionMaker.String() This got broken in 7bd0f7dbae0e93ea1120b70cbb9d5ee7f7b20fce. --- router/connection_maker.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/router/connection_maker.go b/router/connection_maker.go index 280f3c8c..c50b1944 100644 --- a/router/connection_maker.go +++ b/router/connection_maker.go @@ -79,6 +79,12 @@ func (cm *ConnectionMaker) Refresh() { } func (cm *ConnectionMaker) String() string { + // We need to Refresh first in order to clear out any 'attempting' + // connections from cm.targets that have been established since + // the last run of cm.checkStateAndAttemptConnections. These + // entries are harmless but do represent stale state that we do + // not want to report. + cm.Refresh() resultChan := make(chan string, 0) cm.actionChan <- func() bool { var buf bytes.Buffer