1
0
Fork 0
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:
Kubernetes Prow Robot 2024-03-19 04:00:50 -07:00 committed by GitHub
commit c4ff25de52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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