]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Catch ImageBusy exception when deleting rbd volume
authorEdward Hope-Morley <edward.hope-morley@canonical.com>
Wed, 4 Dec 2013 18:13:06 +0000 (18:13 +0000)
committerEdward Hope-Morley <edward.hope-morley@canonical.com>
Thu, 5 Dec 2013 11:30:13 +0000 (11:30 +0000)
commitf31d62a178a370ae9d736c09a3186ea9a3c92ee3
tree10e087fcb9c364abf73e1d5c3ad4b1fed1e9ea12
parente99cd785d8ddbffcd1d741cf336b2e929c6cb28f
Catch ImageBusy exception when deleting rbd volume

If we try to delete an rbd volume that has 'watchers' on it
i.e. client connections that have not yet been closed
possibly because a client crashed, the remove() will throw an
ImageBusy exception. We now catch this exception and raise
VolumeIsBusy with a useful message.

If the volume delete fails in this way it will now stay as
'available' instead of going to 'error_deleting' so that the
delete can be retried (since it is expected to work on a
retry after waiting for the connection to timeout).

Change-Id: I5bc9a5f71bdb0f9c5d12b5577e68377e66561f5b
Closes-bug: 1256259
cinder/tests/test_rbd.py
cinder/volume/drivers/rbd.py