Skip to content

Commit

Permalink
hold spawn on multi seq xtrigs
Browse files Browse the repository at this point in the history
  • Loading branch information
dwsutherland committed Feb 29, 2024
1 parent 217eb13 commit 4c923d3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions cylc/flow/xtrigger_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def call_xtriggers_async(self, itask: 'TaskProxy'):
self.data_store_mgr.delta_task_xtrigger(sig, True)
self.workflow_db_mgr.put_xtriggers({sig: {}})
LOG.info('xtrigger satisfied: %s = %s', label, sig)
if itask.is_xtrigger_sequential:
if self.all_task_seq_xtriggers_satisfied(itask):
self.sequential_spawn_next.add(itask.identity)
self.do_housekeeping = True
continue
Expand All @@ -577,7 +577,7 @@ def call_xtriggers_async(self, itask: 'TaskProxy'):
[itask.tdef.name],
xtrigger_env
)
if itask.is_xtrigger_sequential:
if self.all_task_seq_xtriggers_satisfied(itask):
self.sequential_spawn_next.add(itask.identity)
continue

Expand Down Expand Up @@ -610,6 +610,14 @@ def housekeep(self, itasks):
del self.sat_xtrig[sig]
self.do_housekeeping = False

def all_task_seq_xtriggers_satisfied(self, itask: 'TaskProxy') -> bool:
"""Check if all sequential xtriggers are satisfied for a task."""
return itask.is_xtrigger_sequential and all(
itask.state.xtriggers[label]
for label in itask.state.xtriggers
if label in self.sequential_xtrigger_labels
)

def callback(self, ctx: 'SubFuncContext'):
"""Callback for asynchronous xtrigger functions.
Expand Down

0 comments on commit 4c923d3

Please sign in to comment.