[proxy] web.archive.org← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light
/ cpython Public

Conversation

Copy link
Contributor

idomic commented Feb 23, 2020

Copy link
Contributor Author

idomic commented Feb 23, 2020

@taleinat clean PR

Copy link

codecov bot commented Feb 23, 2020

Codecov Report

Merging #18625 into master will decrease coverage by 0.04%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #18625      +/-   ##
==========================================
- Coverage   82.11%   82.06%   -0.05%     
==========================================
  Files        1956     1955       -1     
  Lines      589428   584089    -5339     
  Branches    44459    44461       +2     
==========================================
- Hits       484010   479356    -4654     
+ Misses      95762    95105     -657     
+ Partials     9656     9628      -28     
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%) ⬇️
Modules/_decimal/libmpdec/umodarith.h 80.76% <0.00%> (-19.24%) ⬇️
Lib/test/test_urllib2net.py 76.92% <0.00%> (-13.85%) ⬇️
Lib/test/test_smtpnet.py 78.57% <0.00%> (-7.15%) ⬇️
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.77%) ⬇️
... and 321 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 b76518d...33db325. Read the comment docs.

Copy link
Contributor Author

idomic commented Mar 1, 2020

Adding @taleinat , do I have to add tests for this?

Copy link
Contributor Author

idomic commented Mar 15, 2020

ping @taleinat

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

Choose a reason for hiding this comment

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

Does this not require the if reduction.HAVE_SEND_HANDLE: check as below?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved the platform check to be included in the HAVE_SEND_HANDLE if block

Copy link
Contributor

Adding @taleinat , do I have to add tests for this?

The test already included seems sufficient.

Copy link
Contributor

ping @taleinat

Sorry, I'm extremely busy these days...

Copy link
Contributor Author

idomic commented Mar 22, 2020

ping @taleinat

Sorry, I'm extremely busy these days...

That's alright, don't worry about it and stay safe!

else:
if reduction.HAVE_SEND_HANDLE:
return ['fork', 'spawn', 'forkserver']
if sys.platform == 'darwin':
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you certain reduction.HAVE_SEND_HANDLE will always be true on macOS? If not 100% this is true on older and future versions, then a similar change should be done in the else clause below.

if sys.platform == 'win32':
self.assertEqual(methods, ['spawn'])
elif sys.platform == 'darwin':
self.assertEqual(methods, ['spawn', 'fork', 'forkserver'])
Copy link
Contributor

Choose a reason for hiding this comment

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

ISTM this should allow 'forkserver' to be missing, as done by the assertion two lines below.

Copy link
Contributor Author

idomic May 17, 2020

Choose a reason for hiding this comment

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

Dropped this test, I agree it's redundant + fixed the code to have the return value in the else clause

Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Copy link
Contributor Author

idomic commented May 24, 2020

I have made the requested changes; please review again

Copy link

Thanks for making the requested changes!

@taleinat: please review the changes made to this pull request.

bedevere-bot requested a review from taleinat May 24, 2020 23:07
return ['spawn']
else:
if sys.platform == 'darwin':
return ['spawn', 'fork', 'forkserver']
Copy link
Contributor

Choose a reason for hiding this comment

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

This breaks the intention of the existing code: The purpose of the HAVE_SEND_HANDLE check is to decide whether to include 'forkserver' as an option. It should be done regardless of platform.

Perhaps just add a conditional after this code the brings 'spawn' to the beginning of the list on macOS.

@@ -0,0 +1,2 @@
Fixed :class:`multiprocessing.context.get_all_start_methods`
If the context is macOS, return the default methods by order.
Copy link
Contributor

Choose a reason for hiding this comment

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

This wording is imprecise; this should always return the default method first, which was not done on the macOS platform.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

Comment on lines 260 to 263
if reduction.HAVE_SEND_HANDLE:
return ['fork', 'spawn', 'forkserver']
else:
return ['fork', 'spawn']
if sys.platform == 'darwin':
return ['spawn', 'fork', 'forkserver']
Copy link
Contributor

Choose a reason for hiding this comment

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

This still needs to return a list without 'forkserver' when HAVE_SEND_HANDLE is false.

Suggested change
if reduction.HAVE_SEND_HANDLE:
return ['fork', 'spawn', 'forkserver']
else:
return ['fork', 'spawn']
if sys.platform == 'darwin':
return ['spawn', 'fork', 'forkserver']
methods = ['spawn', 'fork'] if sys.platform == 'darwin' else ['fork', 'spawn']
if reduction.HAVE_SEND_HANDLE:
methods.append('forkserver')
return methods

Copy link
Contributor

taleinat left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

Thanks @idomic for the PR, and @taleinat for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

Copy link

GH-20431 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 26, 2020
…pythonGH-18625)

(cherry picked from commit db098bc)

Co-authored-by: idomic <michael.ido@gmail.com>
Copy link

GH-20432 is a backport of this pull request to the 3.8 branch.

miss-islington added a commit that referenced this pull request May 26, 2020
…GH-18625)

(cherry picked from commit db098bc)

Co-authored-by: idomic <michael.ido@gmail.com>
miss-islington added a commit that referenced this pull request May 26, 2020
…GH-18625)

(cherry picked from commit db098bc)

Co-authored-by: idomic <michael.ido@gmail.com>
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.

5 participants