From 29277ec3ca168f2f3a285458d3245f7f25e1cbe4 Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Sat, 13 Apr 2024 16:34:01 +1200 Subject: [PATCH] Distinguish never spawned from suicided before submit. --- cylc/flow/task_pool.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cylc/flow/task_pool.py b/cylc/flow/task_pool.py index 2b214d70943..15252840648 100644 --- a/cylc/flow/task_pool.py +++ b/cylc/flow/task_pool.py @@ -1564,8 +1564,8 @@ def _get_task_history( try: submit_num: int = max(s[0] for s in info) except ValueError: - # never spawned before in any flow - submit_num = 0 + # never spawned in any flow + submit_num = -1 prev_status: str = TASK_STATUS_WAITING prev_flow_wait = False @@ -1623,6 +1623,18 @@ def spawn_task( self._get_task_history(name, point, flow_nums) ) + if submit_num == 0: + # Spawned but suicided before it submitted. + # TODO - if `cylc remove` should run again? + # TODO - There's still a timing issue for suicide here! + # (need sleep 2 in task b in the example) + LOG.critical(f"Not spawning {point}/{name} because reasons") + return None + + if submit_num == -1: + # Never spawned before - good. + submit_num = 0 + itask = self._get_task_proxy_db_outputs( point, self.config.get_taskdef(name),