summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhangsong <zhangsong@cmss.chinamobile.com>2017-01-20 18:17:28 +0800
committerCheng Li <shcli@cn.ibm.com>2017-05-25 01:36:07 +0000
commit3db5c2cc4995965686054af09296f955e0a80181 (patch)
treec54685fb1b34cba2f97d7d276c5e8f07cb4d1e64
parent08bfc7d817f313451e619b535299121b686d7bd8 (diff)
RBD:Move RBDVolume calls to a separate threads
RBD is a python binding for librados which isn't patched by eventlet. Time-consuming operations like flattening and copying volumes blocks eventlet loop and all cinder-volume service hangs until it finished. It makes cinder-volume services unavailable for a while. This patch moves all RBDVolume calls to a separate python thread which doesn't block eventlet loop. Change-Id: Id3f2d48428d74011ba690141cee3afad8e48c52f Closes-Bug: #1658037 (cherry picked from commit 8f2b7f4f20727d35d0dce25fddb5a879f26c9614)
Notes
Notes (review): Code-Review+2: Jay Bryant <jungleboyj@electronicjungle.net> Code-Review+2: Ivan Kolodyazhny <e0ne@e0ne.info> Workflow+1: Ivan Kolodyazhny <e0ne@e0ne.info> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Wed, 31 May 2017 14:29:51 +0000 Reviewed-on: https://review.openstack.org/467811 Project: openstack/cinder Branch: refs/heads/stable/newton
-rw-r--r--cinder/volume/drivers/rbd.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/cinder/volume/drivers/rbd.py b/cinder/volume/drivers/rbd.py
index b074d3d..3943f03 100644
--- a/cinder/volume/drivers/rbd.py
+++ b/cinder/volume/drivers/rbd.py
@@ -222,6 +222,7 @@ class RBDVolumeProxy(object):
222 utils.convert_str(name), 222 utils.convert_str(name),
223 snapshot=snapshot, 223 snapshot=snapshot,
224 read_only=read_only) 224 read_only=read_only)
225 self.volume = tpool.Proxy(self.volume)
225 except driver.rbd.Error: 226 except driver.rbd.Error:
226 LOG.exception(_LE("error opening rbd image %s"), name) 227 LOG.exception(_LE("error opening rbd image %s"), name)
227 driver._disconnect_from_rados(client, ioctx) 228 driver._disconnect_from_rados(client, ioctx)