Skip to content

bpo-39244: multiprocessing get all start methods#18529

Closed
idomic wants to merge 17 commits into
python:masterfrom
idomic:bpo-39244multiprocessing-get_all_start_methods
Closed

bpo-39244: multiprocessing get all start methods#18529
idomic wants to merge 17 commits into
python:masterfrom
idomic:bpo-39244multiprocessing-get_all_start_methods

Conversation

@idomic

@idomic idomic commented Feb 16, 2020

Copy link
Copy Markdown
Contributor

bpo-39244: multiprocessing get all start methods

[3.8] bpo-39244: multiprocessing get all start methods (GH-18529)

[3.9] bpo-39244: multiprocessing get all start methods (GH-18529)

https://bugs.python.org/issue39244

Comment thread Lib/multiprocessing/context.py Outdated

def get_all_start_methods(self):
if sys.platform == 'win32':
if sys.platform == 'win32' or sys.platform == 'darwin':

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Presumably, non-spawn start methods still exist.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You're right! I've added a new switch case to deal only with macos

@stefanholek

Copy link
Copy Markdown

Not sure this is the correct fix, fork and forkserver still exist on macOS. I would think get_all_start_methods should return ['spawn', 'fork', 'forkserver'] on macOS.

if sys.platform == 'win32':
return ['spawn']
elif sys.platform == 'darwin':
return ['spawn', 'fork', 'forkserver']

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Is HAVE_SEND_HANDLE guaranteed to be defined on macOS?

@idomic idomic Feb 23, 2020

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's always set from a certain version (could not find documentation for that), the example of the code that defaults to this case and to 'fork' is in the bugs.python.

@idomic

idomic commented Feb 23, 2020

Copy link
Copy Markdown
Contributor Author

Adding @taleinat

@codecov

codecov Bot commented Feb 23, 2020

Copy link
Copy Markdown

Codecov Report

Merging #18529 into master will increase coverage by 0.93%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #18529       +/-   ##
===========================================
+ Coverage   82.20%   83.13%    +0.93%     
===========================================
  Files        1958     1571      -387     
  Lines      589743   414833   -174910     
  Branches    44457    44460        +3     
===========================================
- Hits       484772   344858   -139914     
+ Misses      95308    60347    -34961     
+ Partials     9663     9628       -35     
Impacted Files Coverage Δ
Lib/distutils/tests/test_bdist_rpm.py 30.00% <0.00%> (-65.00%) ⬇️
Lib/distutils/command/bdist_rpm.py 7.63% <0.00%> (-56.88%) ⬇️
Lib/test/test_urllib2net.py 76.92% <0.00%> (-13.85%) ⬇️
Lib/test/test_smtpnet.py 78.57% <0.00%> (-12.86%) ⬇️
Lib/ftplib.py 63.85% <0.00%> (-6.06%) ⬇️
Lib/test/test_ftplib.py 87.11% <0.00%> (-4.72%) ⬇️
Tools/scripts/db2pickle.py 17.82% <0.00%> (-3.97%) ⬇️
Tools/scripts/pickle2db.py 16.98% <0.00%> (-3.78%) ⬇️
Lib/test/test_socket.py 71.94% <0.00%> (-3.87%) ⬇️
Lib/test/test_asyncio/test_base_events.py 91.84% <0.00%> (-3.45%) ⬇️
... and 444 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c33bdbb...c083041. Read the comment docs.

@idomic idomic closed this Feb 23, 2020
@idomic idomic deleted the bpo-39244multiprocessing-get_all_start_methods branch February 23, 2020 15:11
@idomic

idomic commented Feb 23, 2020

Copy link
Copy Markdown
Contributor Author

This is an old PR, please refer to the clean one: GH-18625

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.

5 participants