Skip to content

Commit

Permalink
Merge pull request #8181 from openshift-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…8162-to-release-1.28

[release-1.28] Kill exec PIDs after main container exited
  • Loading branch information
openshift-merge-bot[bot] committed May 16, 2024
2 parents db06cc4 + ed33c3e commit 70c2e96
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/oci/runtime_oci.go
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,6 @@ func (r *runtimeOCI) StopLoopForContainer(c *Container, bm kwait.BackoffManager)

startTime := time.Now()

go c.KillExecPIDs()

// Allow for SIGINT to correctly interrupt the stop loop, especially
// when CRI-O is run directly in the foreground in the terminal.
ctx, stop := signal.NotifyContext(ctx, os.Interrupt)
Expand Down Expand Up @@ -957,6 +955,10 @@ func (r *runtimeOCI) StopLoopForContainer(c *Container, bm kwait.BackoffManager)
}
}, bm, true, ctx.Done())

// Kill the exec PIDs after the main container to avoid pod lifecycle regressions:
// Ref: https://github.com/kubernetes/kubernetes/issues/124743
c.KillExecPIDs()

c.state.Finished = time.Now()
c.opLock.Unlock()
c.SetAsDoneStopping()
Expand Down

0 comments on commit 70c2e96

Please sign in to comment.