Skip to content

Commit

Permalink
Xtrigger housekeep after force-trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Jun 16, 2023
1 parent 7b23772 commit 21eb888
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ async def configure(self):
self.workflow_db_mgr,
self.task_events_mgr,
self.data_store_mgr,
self.flow_mgr
self.flow_mgr,
self.xtrigger_mgr
)

self.data_store_mgr.initiate_data_model()
Expand Down
9 changes: 6 additions & 3 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
from cylc.flow.task_events_mgr import TaskEventsManager
from cylc.flow.workflow_db_mgr import WorkflowDatabaseManager
from cylc.flow.flow_mgr import FlowMgr, FlowNums
from cylc.flow.xtrigger_mgr import XtriggerManager

Pool = Dict['PointBase', Dict[str, TaskProxy]]

Expand All @@ -99,7 +100,8 @@ def __init__(
workflow_db_mgr: 'WorkflowDatabaseManager',
task_events_mgr: 'TaskEventsManager',
data_store_mgr: 'DataStoreMgr',
flow_mgr: 'FlowMgr'
flow_mgr: 'FlowMgr',
xtrigger_mgr: 'XtriggerManager'
) -> None:
self.tokens = tokens
self.config: 'WorkflowConfig' = config
Expand All @@ -110,6 +112,7 @@ def __init__(
self.task_events_mgr.spawn_func = self.spawn_on_output
self.data_store_mgr: 'DataStoreMgr' = data_store_mgr
self.flow_mgr: 'FlowMgr' = flow_mgr
self.xtrigger_mgr: 'XtriggerManager' = xtrigger_mgr

self.do_reload = False
self.max_future_offset: Optional['IntervalBase'] = None
Expand Down Expand Up @@ -572,7 +575,7 @@ def load_db_task_pool_for_restart(self, row_idx, row):
TASK_STATUS_SUCCEEDED,
TASK_STATUS_EXPIRED
)
or itask.is_manual_submit # TODO check abuse of (graduated)
or itask.is_manual_submit
):
self.runahead_release(itask)

Expand Down Expand Up @@ -1766,8 +1769,8 @@ def force_trigger_tasks(
"\nYou may need to trigger this task again"
" to force queue-release."
)
# TODO - does xtrigger manager need to know?
itask.state.xtriggers_set_all_satisfied()
self.xtrigger_mgr.housekeep(self.get_tasks())
self.runahead_release(itask)
continue

Expand Down
5 changes: 4 additions & 1 deletion cylc/flow/task_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,10 @@ def xtriggers_all_satisfied(self):
return all(self.xtriggers.values())

def xtriggers_set_all_satisfied(self):
"""Set all xtriggers to satisfied."""
"""Set all xtriggers to satisfied.
WARNING: you must call xtrigger manager housekeep method after this.
"""
for xtrig in self.xtriggers.keys():
self.xtriggers[xtrig] = True

Expand Down

0 comments on commit 21eb888

Please sign in to comment.