mirror of
https://github.com/kubernetes-sigs/node-feature-discovery.git
synced 2024-12-14 11:57:51 +00:00
Merge pull request #1127 from marquiz/devel/nfd-master-retry
nfd-master: re-try on node update failures
This commit is contained in:
commit
f9cc798057
1 changed files with 7 additions and 3 deletions
|
@ -329,21 +329,25 @@ func (m *nfdMaster) nfdAPIUpdateHandler() {
|
|||
case <-rateLimit:
|
||||
// Check what we need to do
|
||||
// TODO: we might want to update multiple nodes in parallel
|
||||
errUpdateAll := false
|
||||
errNodes := make(map[string]struct{})
|
||||
if updateAll {
|
||||
if err := m.nfdAPIUpdateAllNodes(); err != nil {
|
||||
klog.Error(err)
|
||||
errUpdateAll = true
|
||||
}
|
||||
} else {
|
||||
for nodeName := range updateNodes {
|
||||
if err := m.nfdAPIUpdateOneNode(nodeName); err != nil {
|
||||
klog.Error(err)
|
||||
errNodes[nodeName] = struct{}{}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reset "work queue" and timer
|
||||
updateAll = false
|
||||
updateNodes = make(map[string]struct{})
|
||||
// Reset "work queue" and timer, will cause re-try if errors happened
|
||||
updateAll = errUpdateAll
|
||||
updateNodes = errNodes
|
||||
rateLimit = time.After(time.Second)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue