]> git-server-git.apps.pok.os.sepia.ceph.com Git - teuthology.git/commitdiff
parallel: parallel.__exit__ should always wait for greenlets to finish 833/head
authorSamuel Just <sjust@redhat.com>
Mon, 28 Mar 2016 21:02:05 +0000 (14:02 -0700)
committerSamuel Just <sjust@redhat.com>
Tue, 29 Mar 2016 19:52:48 +0000 (12:52 -0700)
Per the class docstring, one gevent (or the with body) throwing an
exception should not stop the other events.  Instead, wait for them to
finish and then reraise the first exception we find.

A concrete problem caused by this is that with multiple parallel
installs, one failure can cause packaging operations on the other nodes
to be unceremoniously killed and left in an inconsistent state.

Signed-off-by: Samuel Just <sjust@redhat.com>
teuthology/parallel.py

index 13e426e573c044e40230cef38db2c16c5d9db8e5..ac47165a56994c0885ee2238dfb36942a41fac68 100644 (file)
@@ -73,8 +73,9 @@ class parallel(object):
         return self
 
     def __exit__(self, type_, value, traceback):
+        self.group.join()
+
         if value is not None:
-            self.group.kill(block=True)
             return False
 
         try:
@@ -85,7 +86,6 @@ class parallel(object):
         except Exception:
             # Emit message here because traceback gets stomped when we re-raise
             log.exception("Exception in parallel execution")
-            self.group.kill(block=True)
             raise
         return True