Skip to content

bpo-39244: multiprocessing get all start methods #18529

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

Conversation

idomic
Copy link
Contributor

@idomic idomic commented Feb 16, 2020

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

@@ -254,7 +254,7 @@ def get_start_method(self, allow_none=False):
return self._actual_context._name

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

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
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

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.

@@ -256,6 +256,8 @@ def get_start_method(self, allow_none=False):
def get_all_start_methods(self):
if sys.platform == 'win32':
return ['spawn']
elif sys.platform == 'darwin':
return ['spawn', 'fork', 'forkserver']
Copy link

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?

Copy link
Contributor Author

@idomic idomic Feb 23, 2020

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
Copy link
Contributor Author

idomic commented Feb 23, 2020

Adding @taleinat

@codecov
Copy link

codecov bot commented Feb 23, 2020

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
Copy link
Contributor Author

idomic commented Feb 23, 2020

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