]> git.ipfire.org Git - thirdparty/libvirt.git/commit
client: Check if other thread claims it has the buck before claiming it.
authorPeter Krempa <pkrempa@redhat.com>
Fri, 2 Dec 2011 12:51:59 +0000 (13:51 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 2 Dec 2011 13:21:40 +0000 (14:21 +0100)
commitfd066925440ba48acc95d8f31b2c98b1cc9d582d
tree4ec51d9de9dac35f49167a820633942e70a2a4c5
parent8c309caff8aab27e97ad882db4ec907922c85ec8
client: Check if other thread claims it has the buck before claiming it.

Originaly, the code checked if another client is the queue and infered
ownership of the buck from that. Commit fa9595003d043df9f2efe95521c008
added a separate variable to track the buck. That caused, that a new
call might enter claiming it has the buck, while another thread was
signalled to take the buck. This ends in two threads claiming they hold
the buck and entering poll(). This happens due to a race on waking up
threads on the client lock mutex.

This caused multi-threaded clients to hang, most prominently visible and
reproducible on python based clients, like virt-manager.

This patch causes threads, that have been signalled to take the buck to
re-check if buck is held by another thread.
src/rpc/virnetclient.c