File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -509,7 +509,12 @@ func (cm *controllerManager) engageStopProcedure(stopComplete <-chan struct{}) e
509
509
//
510
510
// The shutdown context immediately expires if the gracefulShutdownTimeout is not set.
511
511
var shutdownCancel context.CancelFunc
512
- cm .shutdownCtx , shutdownCancel = context .WithTimeout (context .Background (), cm .gracefulShutdownTimeout )
512
+ if cm .gracefulShutdownTimeout < 0 {
513
+ // We want to wait forever for the runnables to stop.
514
+ cm .shutdownCtx , shutdownCancel = context .WithCancel (context .Background ())
515
+ } else {
516
+ cm .shutdownCtx , shutdownCancel = context .WithTimeout (context .Background (), cm .gracefulShutdownTimeout )
517
+ }
513
518
defer shutdownCancel ()
514
519
515
520
// Start draining the errors before acquiring the lock to make sure we don't deadlock
You can’t perform that action at this time.
0 commit comments