Nir Soffer has posted comments on this change.
Change subject: HACK: run GC in domain monitor ......................................................................
Patch Set 1:
(2 comments)
https://gerrit.ovirt.org/#/c/40380/1//COMMIT_MSG Commit Message:
Line 4: Commit: Adam Litke alitke@redhat.com Line 5: CommitDate: 2015-04-28 16:47:13 -0400 Line 6: Line 7: HACK: run GC in domain monitor Line 8: I like this - this is not a hack! We have a thread dedicated to each storage domain, but we do not use it for most storage domain operations. Line 9: Change-Id: I3c560e6fbccdf50b135cc9c90b23824ae04b0376
https://gerrit.ovirt.org/#/c/40380/1/vdsm/storage/monitor.py File vdsm/storage/monitor.py:
Line 249: Line 250: self._performDomainSelftest() Line 251: self._checkReadDelay() Line 252: self._collectStatistics() Line 253: self._garbageCollect() The domain monitor must wake up every 10 seconds for monitoring the storage, so this must be short operation that never blocks for long time, unless the blocking means that the domain is not accessible.
Collecting garbage here means also that notifying state changes, acquiring host id and setting next status will be delayed.
I think garbage collections should be integrated in the the monitor loop, after _monitorDomain returns, something like this:
deadline = monotonic_time()
while True: deadline += interval monitor domain collect garbage before deadline sleep until deadline
So gc is performed in the time the monitor used to sleep before, and cannot disturb reporting, unless the storage is stuck, which is a fine reason to disturb reporting. Line 254: except Exception as e: Line 255: self.log.exception("Error monitoring domain %s", self.sdUUID) Line 256: self.nextStatus.error = e Line 257: