]> git.proxmox.com Git - qemu-server.git/commit - qmeventd/qmeventd.h
qmeventd: rework 'forced_cleanup' handling and set timeout to 60s
authorDominik Csapak <d.csapak@proxmox.com>
Fri, 23 Sep 2022 09:51:14 +0000 (11:51 +0200)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Fri, 23 Sep 2022 10:00:20 +0000 (12:00 +0200)
commit0a1641aee54577ba368f99d5c7f586062763d355
tree91ff34ca39bd2ac00341a484d110675d262705ea
parent702c2f6ebe7eaba20267df40c7fd7c4d8b9239a0
qmeventd: rework 'forced_cleanup' handling and set timeout to 60s

currently, the 'forced_cleanup' (sending SIGKILL to the qemu process),
is intended to be triggered 5 seconds after sending the initial shutdown
signal (SIGTERM) which is sadly not enough for some setups.

Accidentally, it could be triggered earlier than 5 seconds, if a
SIGALRM triggers in the timespan directly before setting it again.

Also, this approach means that depending on when machines are shutdown
their forced cleanup may happen after 5 seconds, or any time after, if
new vms are shut off in the meantime.

Improve this situation by reworking the way we deal with this cleanup.
We save the pidfd, time incl. timeout in the Client, and set a timeout
to 'epoll_wait' of 10 seconds, which will then trigger a forced_cleanup.
Remove entries from the forced_cleanup list when that entry is killed,
or when the normal cleanup took place.

To improve the shutdown behaviour, increase the default timeout to 60
seconds, which should be enough, but add a commandline toggle where
users can set it to a different value.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
qmeventd/qmeventd.c
qmeventd/qmeventd.h