Skip to content

Commit

Permalink
Use the default multiprocessing pool configuration.
Browse files Browse the repository at this point in the history
Previously we were forcing use of fork for all OSes to try to juice
performance at the cost of running into threading issues at some point
when things got more complex. They may have reached that point with
CI lockups happening on macOS. Revert to the default pool setup to
attempt to fix macOS hangs.
  • Loading branch information
jsirois committed Nov 13, 2024
1 parent 991883c commit 947e897
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pex/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from pex.common import pluralize
from pex.compatibility import Queue, cpu_count
from pex.tracer import TRACER
from pex.typing import TYPE_CHECKING, Generic, cast
from pex.typing import Generic, TYPE_CHECKING

if TYPE_CHECKING:
from typing import (
Expand Down Expand Up @@ -679,12 +679,8 @@ def join(self):
@contextmanager
def _mp_pool(size):
# type: (int) -> Iterator[Pool]
try:
context = multiprocessing.get_context("fork") # type: ignore[attr-defined]
pool = cast("Pool", context.Pool(processes=size))
except (AttributeError, ValueError):
pool = multiprocessing.Pool(processes=size)

pool = multiprocessing.Pool(processes=size)
try:
yield pool
finally:
Expand Down

0 comments on commit 947e897

Please sign in to comment.