From 2720d2418381ded0f1ad2a6778e9640737b4173f Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 18 Sep 2014 06:48:56 +0100 Subject: [PATCH 1/2] Attempt re-connection immediately when notified of a broken connection --- connection_maker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connection_maker.go b/connection_maker.go index 8c259bd5..957603ee 100644 --- a/connection_maker.go +++ b/connection_maker.go @@ -76,8 +76,8 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio if target, found := cm.targets[query.address]; found { target.attempting = false target.tryAfter, target.tryInterval = tryAfter(target.tryInterval) - maybeTick() } + cm.checkStateAndAttemptConnections(time.Now()) default: log.Fatal("Unexpected connection maker query:", query) } From f0191639de67a44da36b0fb7785f167c29aea070 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Thu, 18 Sep 2014 06:51:12 +0100 Subject: [PATCH 2/2] Start the tick again, in case we need it --- connection_maker.go | 1 + 1 file changed, 1 insertion(+) diff --git a/connection_maker.go b/connection_maker.go index 957603ee..4bb4c747 100644 --- a/connection_maker.go +++ b/connection_maker.go @@ -78,6 +78,7 @@ func (cm *ConnectionMaker) queryLoop(queryChan <-chan *ConnectionMakerInteractio target.tryAfter, target.tryInterval = tryAfter(target.tryInterval) } cm.checkStateAndAttemptConnections(time.Now()) + maybeTick() default: log.Fatal("Unexpected connection maker query:", query) }