Skip to content

Commit

Permalink
SacessOptimizer: Fix occasional deadlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl committed Nov 20, 2023
1 parent bcdbd55 commit 3b62ff7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pypesto/optimize/ess/sacess.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ def minimize(
logging_thread = logging.handlers.QueueListener(
multiprocessing.Queue(-1), logging_handler
)
logging_thread.start()

# shared memory manager to handle shared state
# (simulates the sacess manager process)
Expand Down Expand Up @@ -182,6 +181,11 @@ def minimize(
]
for p in worker_processes:
p.start()

# start logging thread only AFTER starting the worker processes
# to prevent deadlocks
logging_thread.start()

# wait for finish
for p in worker_processes:
p.join()
Expand Down

0 comments on commit 3b62ff7

Please sign in to comment.