Fix block eventlet threads on rbd calls

Commit Ibaf43858d60e1320c339f2523b5c09c7f7c7f91e caused new problem with
cross thread communication. According to Python documentation, code can
lead to a deadlock if the spawned thread directly or indirectly attempts
to import a module. python-rados spawns new thread to connect to
cluster. So I removed new spawning new thread to connect to rados. All
long-running operations calls whith python-rbd are still implemented in
native Python threads to block eventlet loop.

Change-Id: Ic9971254102914080383b63cd2807e36213dd6eb
Closes-Bug: #1401335
This commit is contained in:
Ivan Kolodyazhny 2015-07-01 21:54:23 +03:00
parent 6b93625a3d
commit 1bbbd4666a
1 changed files with 4 additions and 8 deletions

View File

@ -319,14 +319,10 @@ class RBDDriver(driver.RetypeVD, driver.TransferVD, driver.ExtendVD,
LOG.debug("opening connection to ceph cluster (timeout=%s).",
self.configuration.rados_connect_timeout)
# NOTE (e0ne): rados is binding to C lbirary librados.
# It blocks eventlet loop so we need to run it in a native
# python thread.
client = tpool.Proxy(
self.rados.Rados(
rados_id=self.configuration.rbd_user,
clustername=self.configuration.rbd_cluster_name,
conffile=self.configuration.rbd_ceph_conf))
client = self.rados.Rados(
rados_id=self.configuration.rbd_user,
clustername=self.configuration.rbd_cluster_name,
conffile=self.configuration.rbd_ceph_conf)
if pool is not None:
pool = utils.convert_str(pool)
else: