Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make libvirt driver get_connection thread-safe
libvirt driver's get_connection is not thread safe in the presence of a libvirtd restart during concurrent incoming requests. With existing code each will in turn call get_connection, find the connection is broken, try to create new one, block for a while and yield to the next thread to do the same. You get as many connections as there are incoming requests and only the last one is used finally. If enough are incoming these connections can exhaust the client pool configured for libvirtd. One fix is to hold a lock while creating the connection. Note that has_min_version calls _conn which calls get_connection and thus the direct call to _has_min_version() Also added the exception text if it fails to register an event handler for lifecycle events. Change-Id: I090765802bfe443440f16722bc7c43b6280fe56a Fixes: bug #1240905
- Loading branch information
Tom Hancock
committed
Oct 23, 2013
1 parent
eda3900
commit b2e64e3
Showing
2 changed files
with
74 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters