[libvirt] libvirtd deadlock on shutdown

Jim Fehlig jfehlig at suse.com
Wed Jun 20 21:07:16 UTC 2012


I'm looking into a libvirtd deadlock on daemon shutdown.  The deadlock
occurs when shutting down virNetServer.  If the handling of a job is in
flight in virNetServerHandleJob(), the virNetServer lock is acquired
when freeing job->prog (src/rpc/virnetserver.c:167).  But the lock is
already held in virNetServerFree(), which is blocked in
virThreadPoolFree() waiting for all the workers to finish.  No progress
can be made.

The attached hack fixes the problem, but I'm not convinced this is an
appropriate fix.  Is it necessary to hold the virNetServer lock when
calling virNetServerProgramFree(job->prog)?  I notice the lock is not
held in the error path of virNetServerHandleJob().

Thanks,
Jim

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shutdown-deadlock.patch
Type: text/x-patch
Size: 542 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20120620/af7892be/attachment-0001.bin>


More information about the libvir-list mailing list