mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-01 07:47:15 +00:00
Merge pull request #9432 from UiPath/fix-clh-wait
clh: isClhRunning waits for full timeout when clh exits
This commit is contained in:
commit
89c85dfe84
@ -1467,7 +1467,12 @@ func (clh *cloudHypervisor) isClhRunning(timeout uint) (bool, error) {
|
|||||||
timeStart := time.Now()
|
timeStart := time.Now()
|
||||||
cl := clh.client()
|
cl := clh.client()
|
||||||
for {
|
for {
|
||||||
err := syscall.Kill(pid, syscall.Signal(0))
|
waitedPid, err := syscall.Wait4(pid, nil, syscall.WNOHANG, nil)
|
||||||
|
if waitedPid == pid && err == nil {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err = syscall.Kill(pid, syscall.Signal(0))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, nil
|
return false, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user