Change in vdsm[master]: block: convert getVolumeMetadataSlot into a contexmanager

alitke at redhat.com alitke at redhat.com
Fri Apr 17 15:22:06 UTC 2015


Adam Litke has posted comments on this change.

Change subject: block: convert getVolumeMetadataSlot into a contexmanager
......................................................................


Patch Set 14:

(2 comments)

https://gerrit.ovirt.org/#/c/25988/14/tests/volumeTests.py
File tests/volumeTests.py:

Line 97: 
Line 98:     def testMetaSlotLock(self):
Line 99:         with self.blksd.getVolumeMetadataSlot(None, 1):
Line 100:             lktaken = self.blksd._lvTagMetaSlotLock.acquire(False)
Line 101:             self.assertEqual(lktaken, False)
> lktaken -> acquired
Done


https://gerrit.ovirt.org/#/c/25988/14/vdsm/storage/blockSD.py
File vdsm/storage/blockSD.py:

Line 714: 
Line 715:     _lvTagMetaSlotLock = threading.Lock()
Line 716: 
Line 717:     @contextmanager
Line 718:     def getVolumeMetadataSlot(self, vol_name, slotSize):
> Calling it like a getter is confusing:
Done
Line 719:         # TODO: _lvTagMetaSlotLock should be relevant only when we use
Line 720:         # getFreeMetadataSlot to avoid a race between getting the occupied
Line 721:         # metadata slots and tagging the new LV (commit to the new slot).
Line 722:         with self._lvTagMetaSlotLock:


-- 
To view, visit https://gerrit.ovirt.org/25988
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id1496238ea4f9a1902f816b20959ce3379e87871
Gerrit-PatchSet: 14
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Adam Litke <alitke at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes


More information about the vdsm-patches mailing list