mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 14:32:33 +00:00
runtime: Failed to clean up resources when QEMU is terminated by signal 15
When QEMU is terminated by signal 15, it deletes the PidFile. Upon detecting that QEMU has exited, the shim executes the stopVM function. If the PidFile is not found, the PID is set to 0. Subsequently, the shim executes `kill -9 0`, which terminates the current process group. This prevents any further logic from being executed, resulting in resources not being cleaned up. Signed-off-by: wangyaqi54 <wangyaqi54@jd.com>
This commit is contained in:
parent
44bf7ccb46
commit
cf4b81344d
@ -1226,7 +1226,7 @@ func (q *qemu) StopVM(ctx context.Context, waitOnly bool) (err error) {
|
||||
return errors.New("cannot determine QEMU PID")
|
||||
}
|
||||
pid := pids[0]
|
||||
|
||||
if pid > 0 {
|
||||
if waitOnly {
|
||||
err := utils.WaitLocalProcess(pid, qemuStopSandboxTimeoutSecs, syscall.Signal(0), q.Logger())
|
||||
if err != nil {
|
||||
@ -1239,7 +1239,7 @@ func (q *qemu) StopVM(ctx context.Context, waitOnly bool) (err error) {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if q.config.SharedFS == config.VirtioFS || q.config.SharedFS == config.VirtioFSNydus {
|
||||
if err := q.stopVirtiofsDaemon(ctx); err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user