Francesco Romani has posted comments on this change. Change subject: utils: Add @throttle decorator ......................................................................
Patch Set 5: Code-Review-1 (2 comments) -1 for visibility, comments inside looks good enough to move forward, but I'd really want to spend some time trying to find a suitable non-leaky alternative. https://gerrit.ovirt.org/#/c/47087/5/tests/vmUtilsTests.py File tests/vmUtilsTests.py: Line 149: class MockSemaphore(object): Line 150: Line 151: def __init__(self, initial=1): Line 152: self.counter = initial Line 153: self.acquireCalled = False please check if @recorded decorator can help you here Line 154: self.releaseCalled = False Line 155: Line 156: def acquire(self, block=True): Line 157: self.acquireCalled = True https://gerrit.ovirt.org/#/c/47087/5/vdsm/virt/utils.py File vdsm/virt/utils.py: Line 120: rmFile(os.path.realpath(sock)) Line 121: rmFile(sock) Line 122: Line 123: Line 124: def throttle(semaphore, block=True, err=None): Please either point me to the case for supporting block=True, or let's drop this - at least for now. Line 125: """ Line 126: Helper decorator for API methods that should have limited number Line 127: of concurrent executions. Line 128: -- To view, visit https://gerrit.ovirt.org/47087 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iab4cf387f77a9b720afb7794e27ed54efa0d3e3c Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Martin Betak <[email protected]> Gerrit-Reviewer: Francesco Romani <[email protected]> Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Martin Betak <[email protected]> Gerrit-Reviewer: Martin Polednik <[email protected]> Gerrit-Reviewer: Vinzenz Feenstra <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
