From 28c3521417d5f2e503d1a68d1cc282c03489d699 Mon Sep 17 00:00:00 2001 From: Ben Clifford Date: Wed, 1 Nov 2023 12:05:05 -0500 Subject: [PATCH] Move task_launch_lock into initial TaskRecord (#2930) 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']))