Skip to content

Commit

Permalink
Distinguish never spawned from suicided before submit.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Apr 13, 2024
1 parent 4b70574 commit 29277ec
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Check warning on line 1632 in cylc/flow/task_pool.py

View check run for this annotation

Codecov / codecov/patch

cylc/flow/task_pool.py#L1631-L1632

Added lines #L1631 - L1632 were not covered by tests

if submit_num == -1:
# Never spawned before - good.
submit_num = 0

itask = self._get_task_proxy_db_outputs(
point,
self.config.get_taskdef(name),
Expand Down

0 comments on commit 29277ec

Please sign in to comment.