Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,12 @@ def patchids(
"""Return a dict[Commit] -> Patchid."""
global _repo, _commit_by_patchid_str
_repo = repo
with multiprocessing.Manager() as manager:
# Use 'fork' explicitly: forkserver (Python 3.14+ default) fails with -1 fds
# when Manager() is called from within asyncio.to_thread().
ctx = multiprocessing.get_context("fork")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can only say that documentation seems to warn a bit on using context "fork" in a multi threaded code

see https://docs.python.org/3/library/multiprocessing.html#multiprocessing-start-methods

with ctx.Manager() as manager:
_commit_by_patchid_str = manager.dict()
with multiprocessing.Pool(multiprocessing.cpu_count()) as p:
with ctx.Pool(multiprocessing.cpu_count()) as p:
p.starmap(
patchid_map_fn,
# Oids objects cannot be pickled so use string representation
Expand Down
Loading