From 8405e0759aa3e2b8778c3e2fe0dc1134ae4abc7f Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Fri, 29 Apr 2016 13:59:25 +0100 Subject: [PATCH] Clarify the function of the periodic ticker. - it either retries for consensus or retries operations we would have tried previously. There is no point retrying pending operations if we are waiting for consensus. --- ipam/allocator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipam/allocator.go b/ipam/allocator.go index 741390fa..6d1ed7c4 100644 --- a/ipam/allocator.go +++ b/ipam/allocator.go @@ -614,11 +614,13 @@ func (alloc *Allocator) actorLoop(actionChan <-chan func(), stopChan <-chan stru case <-stopChan: return case <-alloc.ticker.C: + // Retry things in case messages got lost between here and recipients if alloc.awaitingConsensus { alloc.propose() + } else { + alloc.tryPendingOps() } alloc.removeDeadContainers() - alloc.tryPendingOps() } alloc.assertInvariants()