Change in vdsm[master]: concurrent: Add Barrier class
Dan Kenigsberg has submitted this change and it was merged. Change subject: concurrent: Add Barrier class .. concurrent: Add Barrier class Barrier synchronizes multiple threads. The barrier is created in closed state, blocking all threads invoking wait(). When count threads have entered the barrier, it is opened and all threads return from wait(). Barrier is useful for waiting until multiple threads are ready. Currently we are synchronizing multiple threads in the tests using time.sleep(), which make the tests slower and break randomly on overloaded CI slaves. Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Signed-off-by: Nir Soffer Reviewed-on: https://gerrit.ovirt.org/42927 Continuous-Integration: Jenkins CI Reviewed-by: Ido Barkan Reviewed-by: Dan Kenigsberg --- M lib/vdsm/concurrent.py M tests/concurrentTests.py 2 files changed, 228 insertions(+), 1 deletion(-) Approvals: Nir Soffer: Verified Ido Barkan: Looks good to me, but someone else must approve Jenkins CI: Passed CI tests Dan Kenigsberg: Looks good to me, approved -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 15 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 15: * Update tracker::IGNORE, no Bug-Url found * Set MODIFIED::IGNORE, no Bug-Url found. -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 15 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Dan Kenigsberg has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 14: Code-Review+2 (1 comment) https://gerrit.ovirt.org/#/c/42927/14/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 40: switch switches -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Ido Barkan has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 14: Code-Review+1 looks good. -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 14: Verified+1 This version add the missing test for wait without a timeout. -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 14: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 14 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 13: Verified+1 This version improve readability and correctness, by using enums for barrier state, instead of boolean value. Previously if new threads entered the barrier when it was open, they never waited. Now the barrier is passing exactly count threads each time. If additional threads enter the barrier, when it is draining, they will wait until all threads exit the barrier, and then until count thread entered the barrier. -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 13: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 13 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 12: Verified+1 This version improve readability and documentation. -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 11: (1 comment) https://gerrit.ovirt.org/#/c/42927/11/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 73: if count < 1: Line 74: raise ValueError("Invalid count %d (expecting count >= 1)" % count) Line 75: self._count = count Line 76: self._waiting = 0 Line 77: self._closed = True > true but we also set it a few times and setting it is more readable: self._ Right, but the waiting code is more interesting, so keeping it as is. Line 78: self._cond = threading.Condition(threading.Lock()) Line 79: Line 80: def wait(self, timeout=None): Line 81: """ -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 11: (2 comments) https://gerrit.ovirt.org/#/c/42927/11/tests/concurrentTests.py File tests/concurrentTests.py: Line 60: barrier.wait(0) Line 61: t.join() Line 62: Line 63: @slowtest Line 64: def test_wakup_blocked_thread(self): > wakeup Will fix in next version. Line 65: barrier = concurrent.Barrier(2) Line 66: done = threading.Event() Line 67: Line 68: def waiter(): Line 65: barrier = concurrent.Barrier(2) Line 66: done = threading.Event() Line 67: Line 68: def waiter(): Line 69: barrier.wait(2) > when calling wait, explicitly name timeout=N. it is more readable. Good idea, will change in next version. Line 70: done.set() Line 71: Line 72: t = threading.Thread(target=waiter) Line 73: t.daemon = True -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 12: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 12 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Ido Barkan has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 11: (1 comment) https://gerrit.ovirt.org/#/c/42927/11/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 73: if count < 1: Line 74: raise ValueError("Invalid count %d (expecting count >= 1)" % count) Line 75: self._count = count Line 76: self._waiting = 0 Line 77: self._closed = True > I disagree - the only place we check this flag is in _wait() and _wait_unti true but we also set it a few times and setting it is more readable: self._open = True Line 78: self._cond = threading.Condition(threading.Lock()) Line 79: Line 80: def wait(self, timeout=None): Line 81: """ -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 11: (2 comments) https://gerrit.ovirt.org/#/c/42927/11/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 57: Line 58: for i in range(4): Line 59: threading.Thread(target=thread).start() Line 60: Line 61: # Will block until all 4 threads are blocked on wait(), waking up all > 5 True, will block until 5 thread call wait(), but I was referring to the 4 other threads we started above. I will rephrase this to make it more clear. Line 62: # threads blocked on the barrier. Line 63: barrier.wait() Line 64: Line 65: """ Line 73: if count < 1: Line 74: raise ValueError("Invalid count %d (expecting count >= 1)" % count) Line 75: self._count = count Line 76: self._waiting = 0 Line 77: self._closed = True > IMO using '_open' is clearer. I disagree - the only place we check this flag is in _wait() and _wait_until(), which do: while self._closed: ... Using _self._open, we will have to write: while not self._open: ... Which is less nice. Line 78: self._cond = threading.Condition(threading.Lock()) Line 79: Line 80: def wait(self, timeout=None): Line 81: """ -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Ido Barkan has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 11: Code-Review-1 (4 comments) cool. -1 just for visibility. mostly nits. https://gerrit.ovirt.org/#/c/42927/11/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 57: Line 58: for i in range(4): Line 59: threading.Thread(target=thread).start() Line 60: Line 61: # Will block until all 4 threads are blocked on wait(), waking up all 5 Line 62: # threads blocked on the barrier. Line 63: barrier.wait() Line 64: Line 65: """ Line 73: if count < 1: Line 74: raise ValueError("Invalid count %d (expecting count >= 1)" % count) Line 75: self._count = count Line 76: self._waiting = 0 Line 77: self._closed = True IMO using '_open' is clearer. Line 78: self._cond = threading.Condition(threading.Lock()) Line 79: Line 80: def wait(self, timeout=None): Line 81: """ https://gerrit.ovirt.org/#/c/42927/11/tests/concurrentTests.py File tests/concurrentTests.py: Line 60: barrier.wait(0) Line 61: t.join() Line 62: Line 63: @slowtest Line 64: def test_wakup_blocked_thread(self): wakeup Line 65: barrier = concurrent.Barrier(2) Line 66: done = threading.Event() Line 67: Line 68: def waiter(): Line 65: barrier = concurrent.Barrier(2) Line 66: done = threading.Event() Line 67: Line 68: def waiter(): Line 69: barrier.wait(2) when calling wait, explicitly name timeout=N. it is more readable. Line 70: done.set() Line 71: Line 72: t = threading.Thread(target=waiter) Line 73: t.daemon = True -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Ido Barkan Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 11: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 11 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 10: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 10 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 9: Verified+1 -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 9: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 9 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Adam Litke has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 8: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 8 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Dima Kuznetsov has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 6: (1 comment) https://gerrit.ovirt.org/#/c/42927/6/tests/concurrentTests.py File tests/concurrentTests.py: Line 80: finally: Line 81: t.join() Line 82: Line 83: @permutations([[2], [4], [8], [16], [32], [64], [128], [256]]) Line 84: def test_multiple_threads(self, count): > I wonder how this will perform for values >= 128 on overcrowded CI slaves Good catch, I address this in the next patch, marking it as stresstest. Line 85: timeout = 5.0 Line 86: # Wait for count threads + test thread Line 87: barrier = concurrent.Barrier(count + 1) Line 88: threads = [] -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 7: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 7 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Francesco Romani has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 6: (1 comment) https://gerrit.ovirt.org/#/c/42927/6/tests/concurrentTests.py File tests/concurrentTests.py: Line 80: finally: Line 81: t.join() Line 82: Line 83: @permutations([[2], [4], [8], [16], [32], [64], [128], [256]]) Line 84: def test_multiple_threads(self, count): I wonder how this will perform for values >= 128 on overcrowded CI slaves Line 85: timeout = 5.0 Line 86: # Wait for count threads + test thread Line 87: barrier = concurrent.Barrier(count + 1) Line 88: threads = [] -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Francesco Romani has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 6: Code-Review+1 seems OK and nicely tested -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Francesco Romani Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 6: Verified+1 -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 5: (1 comment) https://gerrit.ovirt.org/#/c/42927/5/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 58: for i in range(4): Line 59: threading.Thread(target=thread).start() Line 60: Line 61: # Will block until all 4 threads are blocked on wait(), waking up all Line 62: # threads blocked on the barraier. > barrier Thanks, fixed. Line 63: barrier.wait() Line 64: Line 65: """ Line 66: -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 6: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 6 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Fabian Deutsch has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 5: (2 comments) https://gerrit.ovirt.org/#/c/42927/5/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 62: barraier barrier Line 112: while self._closed: Line 113: self._cond.wait() Line 114: Line 115: Line 116: Result = namedtuple("Result", ["succeeded", "value"]) Reminds me of the Rust Result type ... Line 117: Line 118: Line 119: def tmap(func, iterable): Line 120: args = list(iterable) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Fabian Deutsch Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Adam Litke has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 5: Verified+1 -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 5: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 5 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 4: (3 comments) https://gerrit.ovirt.org/#/c/42927/4/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 29: Line 30: Line 31: class Barrier(object): Line 32: """ Line 33: A barrier is scynchronizing number of threads specified when the barrier > synchronizing Done Line 34: was created. Line 35: Line 36: A barrier is created in a closed state. While closed, all threads invoking Line 37: wait() will block until count threads have entered the barraier, or the Line 33: A barrier is scynchronizing number of threads specified when the barrier Line 34: was created. Line 35: Line 36: A barrier is created in a closed state. While closed, all threads invoking Line 37: wait() will block until count threads have entered the barraier, or the > barrier Done Line 38: specified timeout has expired. Line 39: Line 40: When the last thread has entered the barrier, the barrier is opened, and Line 41: all threads are woken up. When the last thread has left the barrier, it is Line 43: Line 44: This class is behaves mostly like pthread_barrier_wait(): Line 45: http://linux.die.net/man/3/pthread_barrier_wait. Line 46: Line 47: Unlike pthread_barraier_wait(), this class supports an optional timeout, > pthread_barrier_wait I assume. You assume right Line 48: ensuring that threads will not wait forever. However, if one thread timed Line 49: out, all threads will time out. Line 50: Line 51: Example usage: -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Adam Litke has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 4: (3 comments) https://gerrit.ovirt.org/#/c/42927/4/lib/vdsm/concurrent.py File lib/vdsm/concurrent.py: Line 29: Line 30: Line 31: class Barrier(object): Line 32: """ Line 33: A barrier is scynchronizing number of threads specified when the barrier synchronizing Line 34: was created. Line 35: Line 36: A barrier is created in a closed state. While closed, all threads invoking Line 37: wait() will block until count threads have entered the barraier, or the Line 33: A barrier is scynchronizing number of threads specified when the barrier Line 34: was created. Line 35: Line 36: A barrier is created in a closed state. While closed, all threads invoking Line 37: wait() will block until count threads have entered the barraier, or the barrier Line 38: specified timeout has expired. Line 39: Line 40: When the last thread has entered the barrier, the barrier is opened, and Line 41: all threads are woken up. When the last thread has left the barrier, it is Line 43: Line 44: This class is behaves mostly like pthread_barrier_wait(): Line 45: http://linux.die.net/man/3/pthread_barrier_wait. Line 46: Line 47: Unlike pthread_barraier_wait(), this class supports an optional timeout, pthread_barrier_wait I assume. Line 48: ensuring that threads will not wait forever. However, if one thread timed Line 49: out, all threads will time out. Line 50: Line 51: Example usage: -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: Yes ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 4: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 3: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 3 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
Nir Soffer has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 2: Verified+1 This version replace the CountedEvent with a Barrier, which has a simpler interface but is more useful. -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
Change in vdsm[master]: concurrent: Add Barrier class
automat...@ovirt.org has posted comments on this change. Change subject: concurrent: Add Barrier class .. Patch Set 2: * Update tracker::IGNORE, no Bug-Url found * Check Bug-Url::WARN, no bug url found, make sure header matches 'Bug-Url: ' and is a valid url. * Check merged to previous::IGNORE, Not in stable branch (['ovirt-3.5', 'ovirt-3.4', 'ovirt-3.3']) -- To view, visit https://gerrit.ovirt.org/42927 To unsubscribe, visit https://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68525e18f6b3774d7e10af1226a7bc3404c68ae9 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Nir Soffer Gerrit-Reviewer: Adam Litke Gerrit-Reviewer: Ala Hino Gerrit-Reviewer: Allon Mureinik Gerrit-Reviewer: Dan Kenigsberg Gerrit-Reviewer: Dima Kuznetsov Gerrit-Reviewer: Freddy Rolland Gerrit-Reviewer: Jenkins CI Gerrit-Reviewer: Nir Soffer Gerrit-Reviewer: Yaniv Bronhaim Gerrit-Reviewer: automat...@ovirt.org Gerrit-HasComments: No ___ vdsm-patches mailing list vdsm-patches@lists.fedorahosted.org https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches