]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commit
Take into consideration races in XtremIOClient3
authorGorka Eguileor <geguileo@redhat.com>
Mon, 30 Nov 2015 11:04:58 +0000 (12:04 +0100)
committerGorka Eguileor <geguileo@redhat.com>
Mon, 30 Nov 2015 16:35:18 +0000 (17:35 +0100)
commit89480f159231eae154119da6b46432849b9df20a
tree163bc9cd4a6ea353fb8823bac9cb986e019ce88a
parent78873c7f65d93cdb66eb3b34f6c63de95347777b
Take into consideration races in XtremIOClient3

When working with FC and xtremio is using XtremIOClient3 on FC's
terminate_connection we can get VolumeBackendAPIException saying a
resource could not be found when we shouldn't.

The cause is that Client3 is open to race conditions on 2 methods,
find_lunmap and num_of_mapped_volumes, where a list of mappings is first
retrieved and then we iterate this list to retrieved additional info on
the mappings.

The race would happen if one of the mappings is removed from the backend
in the time it takes to retrieve the additional info after we have
retrieved the list.

This patch fixes this issue by ignoring any mappings that have been
removed and are now NotFound when retrieving additional information for
a mapping in those 2 methods.

This patch also fixes this kind of race problems on volume creation
since it uses find_lumap method.

Closes-Bug: #1521143
Change-Id: I40831e04093ff475395870a333211dd0cb60440f
cinder/tests/unit/test_emc_xtremio.py
cinder/volume/drivers/emc/xtremio.py