IPAM: Make sure we have a ring before calling tryOps()
This commit is contained in:
commit
402fe094f4
1 file changed
+10
-2
+10
-2
@@ -265,6 +265,10 @@ func (alloc *Allocator) tryPendingOps() {
|
|||||||
alloc.tryOps(&alloc.pendingAllocates)
|
alloc.tryOps(&alloc.pendingAllocates)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (alloc *Allocator) havePendingOps() bool {
|
||||||
|
return len(alloc.pendingPrimes)+len(alloc.pendingClaims)+len(alloc.pendingAllocates) > 0
|
||||||
|
}
|
||||||
|
|
||||||
func (alloc *Allocator) spaceRequestDenied(sender mesh.PeerName, r address.Range) {
|
func (alloc *Allocator) spaceRequestDenied(sender mesh.PeerName, r address.Range) {
|
||||||
for i := 0; i < len(alloc.pendingClaims); {
|
for i := 0; i < len(alloc.pendingClaims); {
|
||||||
claim := alloc.pendingClaims[i].(*claim)
|
claim := alloc.pendingClaims[i].(*claim)
|
||||||
@@ -696,8 +700,12 @@ func (alloc *Allocator) actorLoop(actionChan <-chan func(), stopChan <-chan stru
|
|||||||
// Retry things in case messages got lost between here and recipients
|
// Retry things in case messages got lost between here and recipients
|
||||||
if alloc.awaitingConsensus {
|
if alloc.awaitingConsensus {
|
||||||
alloc.propose()
|
alloc.propose()
|
||||||
} else {
|
} else if alloc.havePendingOps() {
|
||||||
alloc.tryPendingOps()
|
if alloc.ring.Empty() {
|
||||||
|
alloc.establishRing()
|
||||||
|
} else {
|
||||||
|
alloc.tryPendingOps()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
alloc.removeDeadContainers()
|
alloc.removeDeadContainers()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user