Skip to content

Commit d3c3f70

Browse files
authored
Move WorkQueue._port_mailbox to be a local variable (#3784)
This is a small step in restricting global/broadly scoped state around multithread/multiprocess use - something which is an ongoing problem in Parsl in general. This change should not change any behaviour as the changed variable was already only used in local scope. # Changed Behaviour none ## Type of change - Code maintenance/cleanup
1 parent c99e0b2 commit d3c3f70

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

parsl/executors/workqueue/executor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ def start(self):
333333

334334
logger.debug("Starting WorkQueueExecutor")
335335

336-
self._port_mailbox = multiprocessing.Queue()
336+
port_mailbox = multiprocessing.Queue()
337337

338338
# Create a Process to perform WorkQueue submissions
339339
submit_process_kwargs = {"task_queue": self.task_queue,
@@ -351,7 +351,7 @@ def start(self):
351351
"wq_log_dir": self.wq_log_dir,
352352
"project_password_file": self.project_password_file,
353353
"project_name": self.project_name,
354-
"port_mailbox": self._port_mailbox,
354+
"port_mailbox": port_mailbox,
355355
"coprocess": self.coprocess
356356
}
357357
self.submit_process = multiprocessing.Process(target=_work_queue_submit_wait,
@@ -366,7 +366,7 @@ def start(self):
366366
self.submit_process.start()
367367
self.collector_thread.start()
368368

369-
self._chosen_port = self._port_mailbox.get(timeout=60)
369+
self._chosen_port = port_mailbox.get(timeout=60)
370370

371371
logger.debug(f"Chosen listening port is {self._chosen_port}")
372372

0 commit comments

Comments
 (0)