mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
Merge pull request #1596 from marquiz/devel/master-infinite-retry
nfd-master: retry node updates indefinitely
This commit is contained in:
commit
c4ff25de52
1 changed files with 6 additions and 5 deletions
|
@ -56,14 +56,15 @@ func (u *nodeUpdaterPool) processNodeUpdateRequest(queue workqueue.RateLimitingI
|
|||
if _, err := u.nfdMaster.getNode(nodeName); apierrors.IsNotFound(err) {
|
||||
klog.InfoS("node not found, skip update", "nodeName", nodeName)
|
||||
} else if err := u.nfdMaster.nfdAPIUpdateOneNode(nodeName); err != nil {
|
||||
if queue.NumRequeues(nodeName) < 15 {
|
||||
klog.InfoS("retrying node update", "nodeName", nodeName, "lastError", err)
|
||||
queue.AddRateLimited(nodeName)
|
||||
return true
|
||||
if n := queue.NumRequeues(nodeName); n < 15 {
|
||||
klog.InfoS("retrying node update", "nodeName", nodeName, "lastError", err, "numRetries", n)
|
||||
} else {
|
||||
klog.ErrorS(err, "failed to update node", "nodeName", nodeName)
|
||||
klog.ErrorS(err, "node update failed, queuing for retry ", "nodeName", nodeName, "numRetries", n)
|
||||
// Count only long-failing attempts
|
||||
nodeUpdateFailures.Inc()
|
||||
}
|
||||
queue.AddRateLimited(nodeName)
|
||||
return true
|
||||
}
|
||||
queue.Forget(nodeName)
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue