Skip to content

Commit

Permalink
daemon/drain.go: bump initial drain sleeps down to 1min
Browse files Browse the repository at this point in the history
Manual backport of openshift#2611
  • Loading branch information
kikisdeliveryservice committed Jun 13, 2021
1 parent e980e4e commit a5ed55c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/daemon/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ func (dn *Daemon) drain() error {
}

dn.logSystem("Update prepared; beginning drain")
failedDrains := 0
startTime := time.Now()

dn.recorder.Eventf(getNodeRef(dn.node), corev1.EventTypeNormal, "Drain", "Draining node to update config.")
Expand All @@ -207,7 +208,12 @@ func (dn *Daemon) drain() error {
default:
if err := drain.RunNodeDrain(dn.drainer, dn.node.Name); err != nil {
glog.Infof("Draining failed with: %v, retrying", err)
time.Sleep(5 * time.Minute)
failedDrains++
if failedDrains > 5 {
time.Sleep(5 * time.Minute)
} else {
time.Sleep(1 * time.Minute)
}
continue
}
close(ret)
Expand Down

0 comments on commit a5ed55c

Please sign in to comment.