mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-06-24 22:43:05 +00:00
shimv2: fix the issue of leaking the hypervisor processes
Since we only send an shutdown qmp command to qemu when do stopSandbox, and didn't wait until qemu process's exit, thus we'd better to make sure it had exited when shimv2 terminated. Thus here to do the last cleanup of the hypervisor. Fixes: #2198 Signed-off-by: fupan.lfp <fupan.lfp@antgroup.com>
This commit is contained in:
parent
7d3cf04f29
commit
4c809a53d2
@ -917,6 +917,11 @@ func (s *service) Shutdown(ctx context.Context, r *taskAPI.ShutdownRequest) (_ *
|
|||||||
|
|
||||||
s.cancel()
|
s.cancel()
|
||||||
|
|
||||||
|
// Since we only send an shutdown qmp command to qemu when do stopSandbox, and
|
||||||
|
// didn't wait until qemu process's exit, thus we'd better to make sure it had
|
||||||
|
// exited when shimv2 terminated. Thus here to do the last cleanup of the hypervisor.
|
||||||
|
syscall.Kill(int(s.hpid), syscall.SIGKILL)
|
||||||
|
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
|
|
||||||
// This will never be called, but this is only there to make sure the
|
// This will never be called, but this is only there to make sure the
|
||||||
|
Loading…
Reference in New Issue
Block a user