fix for STOPPED tasks via stop_task()

they previously killed the main process
This commit is contained in:
niphlod
2016-01-02 22:50:27 +01:00
parent 1ca0c9b0c0
commit 918590d1f3
+1 -3
View File
@@ -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