ariatosca-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxm...@apache.org
Subject incubator-ariatosca git commit: review 2
Date Tue, 27 Jun 2017 14:02:33 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes dc23376a5 -> 26b6c6972


review 2


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/26b6c697
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/26b6c697
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/26b6c697

Branch: refs/heads/ARIA-285-Cancel-execution-may-leave-running-processes
Commit: 26b6c69724cb994975413f526feffae06823a96a
Parents: dc23376
Author: max-orlov <maxim@gigaspaces.com>
Authored: Tue Jun 27 17:02:28 2017 +0300
Committer: max-orlov <maxim@gigaspaces.com>
Committed: Tue Jun 27 17:02:28 2017 +0300

----------------------------------------------------------------------
 aria/orchestrator/workflows/core/engine.py | 21 ++++++++++-----------
 requirements.in                            |  2 +-
 2 files changed, 11 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/26b6c697/aria/orchestrator/workflows/core/engine.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/core/engine.py b/aria/orchestrator/workflows/core/engine.py
index 7d4fe04..7599f23 100644
--- a/aria/orchestrator/workflows/core/engine.py
+++ b/aria/orchestrator/workflows/core/engine.py
@@ -66,23 +66,22 @@ class Engine(logger.LoggerMixin):
                 else:
                     time.sleep(0.1)
             if cancel:
-                try:
-                    self._terminate_tasks(tasks_tracker.executing_tasks)
-                finally:
-                    events.on_cancelled_workflow_signal.send(ctx)
+                self._terminate_tasks(tasks_tracker.executing_tasks)
+                events.on_cancelled_workflow_signal.send(ctx)
             else:
                 events.on_success_workflow_signal.send(ctx)
         except BaseException as e:
             # Cleanup any remaining tasks
-            try:
-                self._terminate_tasks(tasks_tracker.executing_tasks)
-            finally:
-                events.on_failure_workflow_signal.send(ctx, exception=e)
-                raise e
+            self._terminate_tasks(tasks_tracker.executing_tasks)
+            events.on_failure_workflow_signal.send(ctx, exception=e)
+            raise
 
     def _terminate_tasks(self, tasks):
-        for task in tasks:
-            self._executors[task._executor].terminate(task.id)
+        try:
+            for task in tasks:
+                self._executors[task._executor].terminate(task.id)
+        except BaseException:
+            pass
 
     @staticmethod
     def cancel_execution(ctx):

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/26b6c697/requirements.in
----------------------------------------------------------------------
diff --git a/requirements.in b/requirements.in
index f2a9730..723ed51 100644
--- a/requirements.in
+++ b/requirements.in
@@ -33,7 +33,7 @@ PrettyTable>=0.7,<0.8
 click_didyoumean==0.0.3
 backports.shutil_get_terminal_size==1.0.0
 logutils==0.3.4.1
-psutil==5.2.2
+psutil>=5.2.2, < 6.0.0
 importlib ; python_version < '2.7'
 ordereddict ; python_version < '2.7'
 total-ordering ; python_version < '2.7'  # only one version on pypi


Mime
View raw message