]> 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)
committerPatrick East <patrick.east@purestorage.com>
Tue, 30 Sep 2014 19:45:48 +0000 (12:45 -0700)
commit4541521de576297d9b7d4115b040ff54773d9d50
tree6cc5c74106bf2a2a458a6528f280e39a40a39eca
parentb8c8dc8f1059d8c6b76ab5f313ede1edbd77053d
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
cinder/brick/initiator/connector.py
cinder/tests/brick/test_brick_connector.py