Nir Soffer has posted comments on this change. Change subject: domainMonitor: Stop domain monitors concurrently ......................................................................
Patch Set 2: (2 comments) http://gerrit.ovirt.org/#/c/27573/2/vdsm/storage/domainMonitor.py File vdsm/storage/domainMonitor.py: Line 104: domainThread.start() Line 105: # The domain should be added only after it succesfully started Line 106: self._domains[sdUUID] = domainThread Line 107: Line 108: def stopMonitoring(self, sdUUID, wait=True): > How cancellation and wait are related? Shouldn't they be separated patches? Wait and cancellation are two changes needed to stop monitor fast. The main solution is adding the wait api, while the cancellation is avoiding unneeded delays when you try to stop the monitors faster. I'll separate these changes. Line 109: # The domain monitor issues events that might become raceful if Line 110: # you don't wait until a monitor thread exit. Line 111: # Eg: when a domain is detached the domain monitor is stopped and Line 112: # the host id is released. If the monitor didn't actually exit it Line 147: class Canceled(Exception): Line 148: """ Raised by methods decorated with @cancelpoint """ Line 149: Line 150: Line 151: def cancelpoint(meth): > Can we move this to utils? Is there a way to abstract also the loop with ca We can move this to utils, I left it here because I was not sure it was mature enough to for reuse. I'm not sure that handling the Canceled excpetion can be automated, but it is quite simple change to make to another class; Mark the methods you want with @cancelpoint and then handle the Canceled exception where needed. Line 152: """ Line 153: Decorate a method so raises Canceled exception if the methods is invoked Line 154: after the object was canceled. Line 155: -- To view, visit http://gerrit.ovirt.org/27573 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia12f137f1ed055316767e1a9384d8982720bc564 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Allon Mureinik <amure...@redhat.com> Gerrit-Reviewer: Antoni Segura Puimedon <asegu...@redhat.com> Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com> Gerrit-Reviewer: Federico Simoncelli <fsimo...@redhat.com> Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com> Gerrit-Reviewer: Saggi Mizrahi <smizr...@redhat.com> Gerrit-Reviewer: Xavi Francisco <xfran...@redhat.com> Gerrit-Reviewer: Yoav Kleinberger <yklei...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches