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 8f2b7f4f20)
This commit is contained in:
zhangsong 2017-01-20 18:17:28 +08:00 committed by Cheng Li
parent 08bfc7d817
commit 3db5c2cc49
1 changed files with 1 additions and 0 deletions

View File

@ -222,6 +222,7 @@ class RBDVolumeProxy(object):
utils.convert_str(name),
snapshot=snapshot,
read_only=read_only)
self.volume = tpool.Proxy(self.volume)
except driver.rbd.Error:
LOG.exception(_LE("error opening rbd image %s"), name)
driver._disconnect_from_rados(client, ioctx)