Nir Soffer has posted comments on this change.
Change subject: BZ#844656 Release the _syncroot lock during _findDomain
......................................................................
Patch Set 7:
(2 comments)
http://gerrit.ovirt.org/#/c/6822/7/vdsm/storage/sdc.py
File vdsm/storage/sdc.py:
Line 59:
Line 60: def __init__(self, storage_repo):
Line 61: # Acquire order: self._syncProxyCache, self._syncDomainCache
Line 62: self._syncProxyCache = threading.Lock()
Line 63: self._syncDomainCache = threading.Condition(threading.Lock())
This names are little confusing. None of these caches, and they are not the same type of
object - one a lock, the other a condition.
Seems that they should be named:
self._proxyCahceLock
self._domainCacheCond
Line 64:
Line 65: self.__proxyCache = {}
Line 66: self.__domainCache = {}
Line 67: self.__inProgress = set()
Line 78: lvm.invalidateCache()
Line 79: self.storageStale = False
Line 80:
Line 81: # This must be accessed holding the _syncProxyCache lock
Line 82: def __getDomainFromCache(self, sdUUID):
Maybe name this __getDomainFromCacheUnlocked to make it more clear that it must be locked?
Same for __cleanStaleWeakrefs.
Line 83: if self.storageStale == True:
Line 84: return None
Line 85: try:
Line 86: return self.__proxyCache[sdUUID]()
--
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: 7
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini(a)redhat.com>
Gerrit-Reviewer: Ayal Baron <abaron(a)redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Eduardo <ewarszaw(a)gmail.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer(a)redhat.com>
Gerrit-Reviewer: Omri Hochman <hoomri(a)gmail.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: automation(a)ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes