Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.7] bpo-33725: multiprocessing uses spawn by default on macOS (GH-13603) #13626

Closed
wants to merge 1 commit into from
Closed

[3.7] bpo-33725: multiprocessing uses spawn by default on macOS (GH-13603) #13626

wants to merge 1 commit into from

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented May 28, 2019

On macOS, the multiprocessing module now uses the "spawn" start
method by default.

(cherry picked from commit 17a5588)

https://bugs.python.org/issue33725

On macOS, the multiprocessing module now uses the "spawn" start
method by default.

(cherry picked from commit 17a5588)
@vstinner
Copy link
Member Author

Failure on macOS:


1342======================================================================
1343FAIL: test_preload_resources (test.test_multiprocessing_forkserver.TestStartMethod)
1344----------------------------------------------------------------------
1345Traceback (most recent call last):
1346  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/test/_test_multiprocessing.py", line 4469, in test_preload_resources
1347    self.fail("failed spawning forkserver or grandchild")
1348AssertionError: failed spawning forkserver or grandchild
1349
1350Stdout:
1351
1352Traceback (most recent call last):
1353  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/forkserver.py", line 261, in main
1354    old_handlers)
1355  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/forkserver.py", line 297, in _serve_one
1356    code = spawn._main(child_r)
1357  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/spawn.py", line 114, in _main
1358    prepare(preparation_data)
1359  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/spawn.py", line 225, in prepare
1360    _fixup_main_from_path(data['init_main_from_path'])
1361  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/spawn.py", line 277, in _fixup_main_from_path
1362    run_name="__mp_main__")
1363  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/runpy.py", line 263, in run_path
1364    pkg_name=pkg_name, script_name=fname)
1365  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/runpy.py", line 96, in _run_module_code
1366    mod_name, mod_spec, pkg_name, script_name)
1367  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/runpy.py", line 85, in _run_code
1368    exec(code, run_globals)
1369  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/test/mp_preload.py", line 3, in <module>
1370    multiprocessing.Lock()
1371  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/context.py", line 67, in Lock
1372    return Lock(ctx=self.get_context())
1373  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/synchronize.py", line 162, in __init__
1374    SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx)
1375  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/synchronize.py", line 80, in __init__
1376    register(self._semlock.name)
1377  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/semaphore_tracker.py", line 83, in register
1378    self._send('REGISTER', name)
1379  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/semaphore_tracker.py", line 90, in _send
1380    self.ensure_running()
1381  File "/Users/vsts/agent/2.150.3/work/1/s/Lib/multiprocessing/semaphore_tracker.py", line 46, in ensure_running
1382    pid, status = os.waitpid(self._pid, os.WNOHANG)
1383ChildProcessError: [Errno 10] No child processes

@warsaw
Copy link
Member

warsaw commented May 28, 2019

Same error for me when testing locally.

@ned-deily
Copy link
Member

See discussion on the bug tracker. This behavior change should not be backported.

@ned-deily ned-deily closed this May 28, 2019
@vstinner vstinner deleted the mp_macos37 branch May 28, 2019 23:31
@vstinner
Copy link
Member Author

See discussion on the bug tracker. This behavior change should not be backported.

Ok.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants