From 1bbbd4666ae73abd0cbc045a19b27c578a740157 Mon Sep 17 00:00:00 2001 From: Ivan Kolodyazhny Date: Wed, 1 Jul 2015 21:54:23 +0300 Subject: [PATCH] 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 --- cinder/volume/drivers/rbd.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py index 9b8e613f6..f8f9143fa 100644 --- a/cinder/volume/drivers/rbd.py +++ b/cinder/volume/drivers/rbd.py @@ -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: -- 2.45.2