Skip to content

Commit

Permalink
Fixes 3PAR FC driver synchronization
Browse files Browse the repository at this point in the history
While running  stress tests we found missing synchronized methods.
This patch added synchronized anotations around the necessary
methods.

Fixes bug 1172503

Change-Id: I8e475fe38d96ca663fbaac40c5a50420d791f5d5
  • Loading branch information
jbranen committed Apr 25, 2013
1 parent 2522f4d commit beacbd3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cinder/volume/drivers/san/hp/hp_3par_fc.py
Expand Up @@ -116,6 +116,7 @@ def check_for_setup_error(self):
"""Returns an error if prerequisites aren't met."""
self._check_flags()

@lockutils.synchronized('3par-vol', 'cinder-', True)
def create_volume(self, volume):
metadata = self.common.create_volume(volume, self.client)
return {'metadata': metadata}
Expand All @@ -125,9 +126,11 @@ def create_cloned_volume(self, volume, src_vref):
self.client)
return {'metadata': new_vol}

@lockutils.synchronized('3par-vol', 'cinder-', True)
def delete_volume(self, volume):
self.common.delete_volume(volume, self.client)

@lockutils.synchronized('3par-vol', 'cinder-', True)
def create_volume_from_snapshot(self, volume, snapshot):
"""
Creates a volume from a snapshot.
Expand All @@ -136,12 +139,15 @@ def create_volume_from_snapshot(self, volume, snapshot):
"""
self.common.create_volume_from_snapshot(volume, snapshot, self.client)

@lockutils.synchronized('3par-snap', 'cinder-', True)
def create_snapshot(self, snapshot):
self.common.create_snapshot(snapshot, self.client)

@lockutils.synchronized('3par-snap', 'cinder-', True)
def delete_snapshot(self, snapshot):
self.common.delete_snapshot(snapshot, self.client)

@lockutils.synchronized('3par-attach', 'cinder-', True)
def initialize_connection(self, volume, connector):
"""Assigns the volume to a server.
Expand Down Expand Up @@ -193,6 +199,7 @@ def initialize_connection(self, volume, connector):
'target_wwn': ports['FC']}}
return info

@lockutils.synchronized('3par-attach', 'cinder-', True)
def terminate_connection(self, volume, connector, force):
"""
Driver entry point to unattach a volume from an instance.
Expand Down Expand Up @@ -238,11 +245,14 @@ def _create_host(self, volume, connector):

return host

@lockutils.synchronized('3par-exp', 'cinder-', True)
def create_export(self, context, volume):
pass

@lockutils.synchronized('3par-exp', 'cinder-', True)
def ensure_export(self, context, volume):
pass

@lockutils.synchronized('3par-exp', 'cinder-', True)
def remove_export(self, context, volume):
pass

0 comments on commit beacbd3

Please sign in to comment.