Skip to content

Commit

Permalink
Merge pull request kubernetes#2220 from mborsz/race
Browse files Browse the repository at this point in the history
Avoid race in subsequent changes to the same controller
  • Loading branch information
k8s-ci-robot authored Dec 19, 2022
2 parents 83e45df + 19927c1 commit ce673a9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ func (w *waitForControlledPodsRunningMeasurement) waitForRuntimeObject(obj runti
o := newObjectChecker(key)
o.lock.Lock()
defer o.lock.Unlock()
ctx, cancel := context.WithCancel(ctx)
o.cancel = cancel
w.handlingGroup.Start(func() {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
o.SetCancel(cancel)
if operationTimeout != time.Duration(0) {
ctx, cancel = context.WithTimeout(ctx, operationTimeout)
defer cancel()
Expand Down

0 comments on commit ce673a9

Please sign in to comment.