]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Fix race condition in ISCSIConnector _disconnect_volume_multipath_iscsi
authorPatrick East <patrick.east@purestorage.com>
Tue, 30 Sep 2014 18:47:42 +0000 (11:47 -0700)
committerThierry Carrez <thierry@openstack.org>
Wed, 8 Oct 2014 10:28:28 +0000 (12:28 +0200)
commitc566767d6a5041d1d86b1e199028d78772ebc508
treeae59f42bcfc1c7dcf26c54bf2b51c382be98d85d
parent20d1476624d7257bd7f5439a54f802fd4f20f765
Fix race condition in ISCSIConnector _disconnect_volume_multipath_iscsi

This is a similar issue as seen in
https://bugs.launchpad.net/cinder/+bug/1375382

The list of devices returned by driver.get_all_block_devices() in
_disconnect_volume_multipath_iscsi will potentially contain broken
symlinks as the SCSI devices have been deleted from calling
self._linuxscsi.remove_multipath_device(device_realpath) right before
_disconnect_volume_multipath_iscsi but the udev rule for the symlink
may not yet have completed.

Adding in a check to os.path.exists() will ensure that we will not
consider the broken symlinks as an “in use” device.

Change-Id: I79c9627e9b47127d3765fcec5b7e3bacef179630
Closes-Bug: #1375946
(cherry picked from commit 4541521de576297d9b7d4115b040ff54773d9d50)
cinder/brick/initiator/connector.py
cinder/tests/brick/test_brick_connector.py