From ce75badaf4ac6db73bc87c2e5551cb4a860cf61f Mon Sep 17 00:00:00 2001 From: Hilary James Oliver Date: Sun, 14 Aug 2022 18:35:13 +1200 Subject: [PATCH] Datastore fix for removed taskdef. --- cylc/flow/data_store_mgr.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cylc/flow/data_store_mgr.py b/cylc/flow/data_store_mgr.py index c54cacc8b3d..bc5d82d6cbd 100644 --- a/cylc/flow/data_store_mgr.py +++ b/cylc/flow/data_store_mgr.py @@ -818,12 +818,15 @@ def generate_ghost_task(self, tp_id, itask, is_parent=False): if is_orphan: self.generate_orphan_task(itask) - # Most the time the definition node will be in the store, - # so use try/except. + # Most of the time the definition node will be in the store, try: task_def = self.data[self.workflow_id][TASKS][t_id] except KeyError: - task_def = self.added[TASKS][t_id] + try: + task_def = self.added[TASKS][t_id] + except KeyError: + # Task removed from workflow definition. + return False update_time = time() tp_stamp = f'{tp_id}@{update_time}'