Skip to content

Commit 57aecd4

Browse files
fix: prevent hanging multiprocessing
1 parent e978bd5 commit 57aecd4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

taskqueue/taskqueue.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,10 @@ def capturing_soloprocess_upload(*args, **kwargs):
563563
if platform.system().lower() == "darwin":
564564
os.environ["no_proxy"] = "*"
565565

566+
# Don't fork, spawn entirely new processes. This
567+
# avoids accidental deadlocks.
568+
mp.set_start_method("spawn", force=True)
569+
566570
ct = 0
567571
with tqdm(desc="Upload", total=total) as pbar:
568572
with pathos.pools.ProcessPool(parallel) as pool:

0 commit comments

Comments
 (0)