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]()