Skip to content

Commit

Permalink
Fix restart after adding new deps to spawned task.
Browse files Browse the repository at this point in the history
  • Loading branch information
hjoliver committed Jan 30, 2023
1 parent 9e04264 commit a45e438
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
7 changes: 6 additions & 1 deletion cylc/flow/data_store_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,12 @@ def apply_task_proxy_db_history(self):
self.db_load_task_proxies[ikey][0].state.prerequisites
):
for key in itask_prereq.satisfied.keys():
itask_prereq.satisfied[key] = prereqs[key]
try:
itask_prereq.satisfied[key] = prereqs[key]
except KeyError:
# This prereq is not in the DB: new dependencies
# added to an already-spawned task before restart.
itask_prereq.satisfied[key] = False

# Extract info from itasks to data-store.
for task_info in self.db_load_task_proxies.values():
Expand Down
15 changes: 11 additions & 4 deletions cylc/flow/task_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,12 +500,19 @@ def load_db_task_pool_for_restart(self, row_idx, row):
flow_nums,
)
):
key = (prereq_cycle, prereq_name, prereq_output)
sat[key] = satisfied if satisfied != '0' else False
# Prereq satisfaction as recorded in the DB.
sat[
(prereq_cycle, prereq_name, prereq_output)
] = satisfied if satisfied != '0' else False

for itask_prereq in itask.state.prerequisites:
for key, _ in itask_prereq.satisfied.items():
itask_prereq.satisfied[key] = sat[key]
for key in itask_prereq.satisfied.keys():
try:
itask_prereq.satisfied[key] = sat[key]
except KeyError:
# This prereq is not in the DB: new dependencies
# added to an already-spawned task before restart.
itask_prereq.satisfied[key] = False

if itask.state_reset(status, is_runahead=True):
self.data_store_mgr.delta_task_runahead(itask)
Expand Down

0 comments on commit a45e438

Please sign in to comment.