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.
This commit is contained in:
Bryan Boreham committed 2016-05-03 15:13:20 +01:00
1 parent be3b0aa976
commit 8405e0759a
1 file changed
+3 -1
+3 -1
View File
@@ -614,11 +614,13 @@ func (alloc *Allocator) actorLoop(actionChan <-chan func(), stopChan <-chan stru
case <-stopChan: case <-stopChan:
return return
case <-alloc.ticker.C: case <-alloc.ticker.C:
// Retry things in case messages got lost between here and recipients
if alloc.awaitingConsensus { if alloc.awaitingConsensus {
alloc.propose() alloc.propose()
} else {
alloc.tryPendingOps()
} }
alloc.removeDeadContainers() alloc.removeDeadContainers()
alloc.tryPendingOps()
} }
alloc.assertInvariants() alloc.assertInvariants()