Change in vdsm[master]: [WIP] BZ#844656 Release the lock during _findDomain

smizrahi at redhat.com smizrahi at redhat.com
Wed Aug 1 16:14:01 UTC 2012


Saggi Mizrahi has posted comments on this change.

Change subject: [WIP] BZ#844656 Release the lock during _findDomain
......................................................................


Patch Set 2: I would prefer that you didn't submit this

(2 inline comments)

I've put my version of the locking scheme.
I'm sure you can figure out the advantages.

....................................................
File vdsm/storage/sdc.py
Line 115:         with self._syncroot:
with self._syncroot:
  while True:
     domain = self._domainCache.get(sdUUID)
     if domain is not None:
         return domain

     if sdUUID in self.__inProgress:
          self._syncroot.wait()
          continue

     self._inProgress.add(sdUUID)

try:
  domain = self._findDomain(sdUUID)
  self.__domainCache[sdUUID] = domain
  return Domain
finally:
  with self._syncroot:
     self._inProgress.remove(sdUUID)
     self._syncroot.notifyAll()

Line 135:                 if domain:
Why put in finally then? Either put inside the try or in an else clause.

--
To view, visit http://gerrit.ovirt.org/6822
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I8088d5fe716a3a08c3e5cef2d2d9a654ee96f60a
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi at redhat.com>


More information about the vdsm-patches mailing list