Skip to content

Conversation

@KeremTurgutlu
Copy link

Fix BrokenProcessPool error on macOS by using forkserver method

Fixes #1256

Problem

nbdev_test fails on macOS with BrokenProcessPool error due to Objective-C runtime fork-safety issues. Current workarounds require setting environment variables or using --n_workers 0.

Solution

Use forkserver multiprocessing method on macOS when running outside notebooks. This avoids fork-safety issues by forking from a clean server process before problematic libraries are loaded.

Changes

  • Updated nbdev_test to use {'method':'forkserver'} on macOS (sys.platform=='darwin') when not in notebooks
  • Maintains existing behavior for other platforms

@KeremTurgutlu KeremTurgutlu requested a review from jph00 January 22, 2026 07:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nbdev_test breaks on Apple M1 due to BrokenAccessPool

2 participants