On 3/19/20 10:56 AM, Eric Blake wrote:
Ideally, we need to fix libnbd TLS support to do cleaner shutdown.
I'm still working on that larger task.
Pragmatically, nbdkit's tests/functions.sh start_nbdkit() function right now tries only a single:
cleanup_fn kill "$(cat "$pidfile")"
without waiting to see if it actually worked. We could probably turn that into a more robust kill_nbdkit() function that first tries the graceful SIGTERM, waits a few seconds to confirm whether the process actually died, and follows up with a harder SIGKILL as needed (preferably failing a test whenever SIGTERM was insufficient). It may not solve the bug in libnbd TLS shutdown, but would at least prevent stuck processes.
But this one is now posted for review. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3226 Virtualization: qemu.org | libvirt.org