Re: [PATCH v2 2/2] virnetdaemon: Wait for "daemon-stop" thread to finish before quitting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On a Friday in 2020, Michal Privoznik wrote:
When the host is shutting down then we get PrepareForShutdown
signal on DBus to which we react by creating a thread which
runs virStateStop() and thus qemuStateStop(). But if scheduling
the thread is delayed just a but it may happen that we receive
SIGTERM (sent by systemd) to which we respond by quitting our
event loop and cleaning up everything (including drivers). And
only after that the thread gets to run only to find qemu_driver
being NULL.

What we can do is to delay exiting event loop and join the thread
that's executing virStateStop(). If the join doesn't happen in
given timeout (currently 30 seconds) then libvirtd shuts down
forcefully anyways (see virNetDaemonRun()).

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1895359


Also, https://bugzilla.redhat.com/show_bug.cgi?id=1739564

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/libvirt_remote.syms    |  1 +
src/remote/remote_daemon.c | 15 ++++++++++++---
src/rpc/virnetdaemon.c     | 17 +++++++++++++++++
src/rpc/virnetdaemon.h     |  3 +++
4 files changed, 33 insertions(+), 3 deletions(-)


Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Thanks for fixing this.

Jano

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux