Merge pull request #19533 from hangscer8/fix_waitPidStop_timer

Stop timer in function waitPidStop
This commit is contained in:
OpenShift Merge Robot 2023-08-08 06:59:20 -04:00 committed by GitHub
commit 406c480535
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -1000,6 +1000,7 @@ func waitContainerStop(ctr *Container, timeout time.Duration) error {
// Wait for a given PID to stop
func waitPidStop(pid int, timeout time.Duration) error {
timer := time.NewTimer(timeout)
defer timer.Stop()
for {
select {
case <-timer.C: