From 509f375b8f6dccec3f725bb4447ecf508e0c99d7 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Thu, 12 Oct 2023 13:29:31 +0000 Subject: [PATCH] Move task_launch_lock into initial TaskRecord There's no reason for it to be omitted and added later, and this style is more defensive. --- parsl/dataflow/dflow.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/parsl/dataflow/dflow.py b/parsl/dataflow/dflow.py index c494346533..69d278b402 100644 --- a/parsl/dataflow/dflow.py +++ b/parsl/dataflow/dflow.py @@ -984,6 +984,7 @@ def submit(self, 'joins': None, 'try_id': 0, 'id': task_id, + 'task_launch_lock': threading.Lock(), 'time_invoked': datetime.datetime.now(), 'time_returned': None, 'try_time_launched': None, @@ -1029,8 +1030,6 @@ def submit(self, task_record['func_name'], waiting_message)) - task_record['task_launch_lock'] = threading.Lock() - app_fu.add_done_callback(partial(self.handle_app_update, task_record)) self.update_task_state(task_record, States.pending) logger.debug("Task {} set to pending state with AppFuture: {}".format(task_id, task_record['app_fu']))