Skip to content

bpo-41544: Add missing parameters to dummy.DummyProcess and dummy.Pool #21869

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

moi90
Copy link
Contributor

@moi90 moi90 commented Aug 13, 2020

Add missing parameters to multiprocessing.dummy.DummyProcess in order to match the API of multiprocessing.Process.

https://bugs.python.org/issue41544

Introduce daemon parameter to multiprocessing.dummy.DummyProcess in order to match the API of multiprocessing.
@the-knights-who-say-ni
Copy link

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@moi90

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You can check yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

@ZackerySpytz
Copy link
Contributor

This needs a unit test.

@moi90
Copy link
Contributor Author

moi90 commented Oct 10, 2020

It seems to me that there are not tests at all for DummyProcess. Is that right?
Any directions where to put them and how to get startet?

I'd appreciate any help with this.

@moi90
Copy link
Contributor Author

moi90 commented Nov 7, 2021

I added test_multiprocessing_dummy and it runs successfully. It shouldn't, however, because install_tests_in_module_dict calls multiprocessing.set_start_method("dummy") (in setUpModule) which should fail with a ValueError that is converted to a unittest.SkipTest. But the test is not skipped. Can someone explain this behavior?

EDIT: It seems that if setUpModule raises SkipTest, the file is displayed as "successful" by the test runner. Isn't that inaccurate?

In my eyes, to make use of the current test machinery, we need to make "dummy" a supported (but maybe undocumented) start method.

EDIT: I see why this doesn't work: The threading module requires a properly initialized multiprocessing context (which of cause can not be a threading-based dummy).

@moi90
Copy link
Contributor Author

moi90 commented Nov 7, 2021

I moved on to checking only the signatures. Also, I added the missing maxtasksperchild for dummy.Pool. Technically, this would be another pull request but I think it can be included here.

@moi90
Copy link
Contributor Author

moi90 commented Nov 12, 2021

@ZackerySpytz What do you think?

@applio, @pitrou Could you have a look?

@moi90 moi90 changed the title bpo-41544: Introduce daemon parameter to DummyProcess bpo-41544: Add missing parameters to DummyProcess Dec 2, 2021
@moi90 moi90 changed the title bpo-41544: Add missing parameters to DummyProcess bpo-41544: Add missing parameters to dummy.DummyProcess and dummy.Pool Dec 2, 2021
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.

6 participants