Change in vdsm[master]: clusterlock: add the local locking implementation
abaron at redhat.com
abaron at redhat.com
Sun Jan 6 14:30:11 UTC 2013
Ayal Baron has posted comments on this change.
Change subject: clusterlock: add the local locking implementation
......................................................................
Patch Set 1: (4 inline comments)
....................................................
File vdsm/storage/clusterlock.py
Line 281: def setParams(self, *args):
Line 282: pass
Line 283:
Line 284: def getReservedId(self):
Line 285: return MAX_HOST_ID
should be 0 or 1
Line 286:
Line 287: def acquireHostId(self, hostId, async):
Line 288: self.log.debug("Host id for domain %s successfully acquired (id: %s)",
Line 289: self._sdUUID, hostId)
Line 333: # Raise any other unkown error.
Line 334: if e.errno != os.errno.EBADF:
Line 335: raise
Line 336: else:
Line 337: self.log.debug("Cluster lock already acquired for domain "
not a cluster lock
Line 338: "%s (id: %s)", self._sdUUID, hostId)
Line 339: return # success, the lock was already acquired
Line 340:
Line 341: lockFile = self.__os_safe_open(self._idsPath, os.O_RDONLY)
Line 345: except IOError, e:
Line 346: self.__os_safe_close(lockFile)
Line 347: if e.errno in (os.errno.EACCES, os.errno.EAGAIN):
Line 348: raise se.AcquireLockFailure(self._sdUUID, e.errno,
Line 349: "Cannot acquire cluster lock", str(e))
not a cluster lock
Line 350: raise
Line 351: else:
Line 352: self._globalLockMap[self._sdUUID] = lockFile
Line 353:
Line 350: raise
Line 351: else:
Line 352: self._globalLockMap[self._sdUUID] = lockFile
Line 353:
Line 354: self.log.debug("Cluster lock for domain %s successfully acquired "
not a cluster lock
Line 355: "(id: %s)", self._sdUUID, hostId)
Line 356:
Line 357: def release(self):
Line 358: with self._lock:
--
To view, visit http://gerrit.ovirt.org/10282
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I106618a9a61cc96727edaf2e3ab043b2ec28ebe1
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron at redhat.com>
Gerrit-Reviewer: Maor Lipchuk <mlipchuk at redhat.com>
Gerrit-Reviewer: Vered Volansky <vvolansk at redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
More information about the vdsm-patches
mailing list