Commit 046cd97
Resolve multiprocessing deadlock warning by switching to 'spawn' start method
This commit addresses a DeprecationWarning related to using `fork()` in multi-threaded processes, which can lead to deadlocks in the child processes when using Python's `multiprocessing` module.
- Modified the `batch_run` function to set the multiprocessing start method to 'spawn' by default.
- The 'spawn' method avoids the issues that arise from forking in a multi-threaded environment by starting a new Python interpreter process for each worker, which is safer and more compatible with modern systems.
- This change ensures that the warning related to multi-threading and `fork()` is resolved across all environments where multiprocessing is used.
The change is applied globally to ensure consistent behavior in both code execution and testing environments. The test suite should now run without issuing a DeprecationWarning, and the multiprocessing behavior will be more robust, especially in environments that rely on threads.1 parent ee528cb commit 046cd97
1 file changed
+3
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| 12 | + | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
0 commit comments