]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix block eventlet threads on rbd calls
authorIvan Kolodyazhny <e0ne@e0ne.info>
Wed, 1 Jul 2015 18:54:23 +0000 (21:54 +0300)
committerIvan Kolodyazhny <e0ne@e0ne.info>
Wed, 1 Jul 2015 18:54:23 +0000 (21:54 +0300)
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

cinder/volume/drivers/rbd.py

index 9b8e613f6c43d2edc8f0ac477757f5c5e67fb47e..f8f9143fa1a7dd1c65f229339f8abc3b0df27bec 100644 (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: