Requeue failed updates for retry in CIDR allocator

This commit is contained in:
Shyam Jeedigunta 2017-11-27 12:57:29 +01:00
parent 4b5ca13135
commit 02a7e92bcf
2 changed files with 8 additions and 2 deletions

View File

@ -146,7 +146,10 @@ func (ca *cloudCIDRAllocator) worker(stopChan <-chan struct{}) {
glog.Warning("Channel nodeCIDRUpdateChannel was unexpectedly closed")
return
}
ca.updateCIDRAllocation(workItem)
if err := ca.updateCIDRAllocation(workItem); err != nil {
// Requeue the failed node for update again.
ca.nodeUpdateChannel <- workItem
}
case <-stopChan:
return
}

View File

@ -176,7 +176,10 @@ func (r *rangeAllocator) worker(stopChan <-chan struct{}) {
glog.Warning("Channel nodeCIDRUpdateChannel was unexpectedly closed")
return
}
r.updateCIDRAllocation(workItem)
if err := r.updateCIDRAllocation(workItem); err != nil {
// Requeue the failed node for update again.
r.nodeCIDRUpdateChannel <- workItem
}
case <-stopChan:
return
}