Eduardo has uploaded a new change for review.
Change subject: Provisional fix: the domain is produced in the monitor thread.
......................................................................
Provisional fix: the domain is produced in the monitor thread.
This should reduce the number of vgs in connectStoragePool thread.
Change-Id: I5a2d332b7bc930e681ba23141978ea4f523338d5
Signed-off-by: Eduardo <ewarszaw(a)redhat.com>
---
M vdsm/storage/domainMonitor.py
M vdsm/storage/sp.py
2 files changed, 7 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/63/7163/1
diff --git a/vdsm/storage/domainMonitor.py b/vdsm/storage/domainMonitor.py
index afda7b1..8bae2f6 100644
--- a/vdsm/storage/domainMonitor.py
+++ b/vdsm/storage/domainMonitor.py
@@ -75,18 +75,18 @@
def monitoredDomains(self):
return self._domains.keys()
- def startMonitoring(self, domain, hostId):
- if domain.sdUUID in self._domains:
+ def startMonitoring(self, sdUUID, hostId):
+ if sdUUID in self._domains:
return
status = DomainMonitorStatus()
stopEvent = Event()
thread = Thread(target=self._monitorDomain,
- args=(domain, hostId, stopEvent, status))
+ args=(sdUUID, hostId, stopEvent, status))
thread.setDaemon(True)
thread.start()
- self._domains[domain.sdUUID] = (stopEvent, thread, status)
+ self._domains[sdUUID] = (stopEvent, thread, status)
def stopMonitoring(self, sdUUID):
if sdUUID not in self._domains:
@@ -110,7 +110,8 @@
for sdUUID in self._domains.keys():
self.stopMonitoring(sdUUID)
- def _monitorDomain(self, domain, hostId, stopEvent, status):
+ def _monitorDomain(self, sdUUID, hostId, stopEvent, status):
+ domain = sdCache.produce(sdUUID)
nextStatus = DomainMonitorStatus()
isIsoDomain = domain.isISO()
lastRefresh = time()
diff --git a/vdsm/storage/sp.py b/vdsm/storage/sp.py
index ee45151..7ca2cd6 100644
--- a/vdsm/storage/sp.py
+++ b/vdsm/storage/sp.py
@@ -1554,7 +1554,7 @@
if sdUUID not in monitoredDomains:
try:
self.domainMonitor \
- .startMonitoring(sdCache.produce(sdUUID), self.id)
+ .startMonitoring(sdUUID, self.id)
self.log.debug("Storage Pool `%s` started monitoring "
"domain `%s`", self.spUUID, sdUUID)
except se.StorageException:
--
To view, visit
http://gerrit.ovirt.org/7163
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5a2d332b7bc930e681ba23141978ea4f523338d5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Eduardo <ewarszaw(a)redhat.com>