Skip to content

Commit

Permalink
handle restart/reload/remove
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsutherland committed Oct 6, 2023
1 parent 3248197 commit 969a861
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,14 @@ def reload_taskdefs(self, config: 'WorkflowConfig') -> None:
self.check_task_output,
)
self._swap_out(new_task)
# Set xtrigger checking type for parentless spawning.
if (
new_task.tdef.is_parentless(new_task.point)
and set(new_task.state.xtriggers.keys()).intersection(
self.xtrigger_mgr.sequential_xtrigger_labels
)
):
new_task.is_xtrigger_sequential = True
self.data_store_mgr.delta_task_prerequisite(new_task)
LOG.info(f"[{itask}] reloaded task definition")
if itask.state(*TASK_STATUSES_ACTIVE):
Expand Down Expand Up @@ -1705,6 +1713,13 @@ def remove_tasks(self, items):
"""Remove tasks from the pool."""
itasks, _, bad_items = self.filter_task_proxies(items)
for itask in itasks:
# Spawn next occurance of xtrigger sequential task.
if itask.is_xtrigger_sequential:
self.spawn_to_rh_limit(
itask.tdef,
itask.tdef.next_point(itask.point),
itask.flow_nums
)
self.remove(itask, 'request')
if self.compute_runahead():
self.release_runahead_tasks()
Expand Down

0 comments on commit 969a861

Please sign in to comment.