From 918590d1f3853cf795a2b998c4554d985e977c16 Mon Sep 17 00:00:00 2001 From: niphlod Date: Sat, 2 Jan 2016 22:50:27 +0100 Subject: [PATCH] fix for STOPPED tasks via stop_task() they previously killed the main process --- gluon/scheduler.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gluon/scheduler.py b/gluon/scheduler.py index dae66a5f..e89b82fa 100644 --- a/gluon/scheduler.py +++ b/gluon/scheduler.py @@ -391,7 +391,6 @@ class MetaScheduler(threading.Thread): except: p.terminate() p.join() - self.have_heartbeat = False logger.debug(' task stopped by general exception') tr = TaskReport(STOPPED) else: @@ -406,7 +405,6 @@ class MetaScheduler(threading.Thread): except Queue.Empty: tr = TaskReport(TIMEOUT) elif queue.empty(): - self.have_heartbeat = False logger.debug(' task stopped') tr = TaskReport(STOPPED) else: @@ -922,7 +920,7 @@ class Scheduler(MetaScheduler): else: st_mapping = {'FAILED': 'FAILED', 'TIMEOUT': 'TIMEOUT', - 'STOPPED': 'QUEUED'}[task_report.status] + 'STOPPED': 'FAILED'}[task_report.status] status = (task.retry_failed and task.times_failed < task.retry_failed and QUEUED or task.retry_failed == -1