-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
gh-91090: Make started multiprocessing.Process instances and started multiprocessing.managers.BaseManager instances serialisable #31701
base: main
Are you sure you want to change the base?
Conversation
Up-voting this PR and hoping it would be merged soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look at this soon but it needs tests and news entry.
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 |
@maggyero, please avoid force-pushing; instead use |
@erlend-aasland Thanks for the review requests and force-pushing advice. About the latter, I actually did not rebase my branch on the main branch and force pushed (‘Update with rebase’ in the GitHub UI), I just amended my last commits and force pushed. The link you provided says the following about force pushing:
I am wondering if this is a valid exception to this rule: is it okay for a developer to amend and force push the commits that were pushed after the last code review comment, for instance if he realizes that he made a mistake or forgot something while addressing the reviewers’ comments? Basically like I did: I did not touch the commits preceding @kumaraditya303’s comment but amended some following commits and force pushed. Or is it a strict rule (never force push)? |
@kumaraditya303 I have made the requested changes; please review again. |
Thanks for making the requested changes! @kumaraditya303: please review the changes made to this pull request. |
Regarding force-pushing:
Eric left a comment regarding force-pushing on a PR a while ago; it is worth a read: #31616 (comment) I'll put some more emphasis on being respectful of the reviewer's time: IMO, one of the best things one can do in order to respect the reviewers time is to keep PRs focused on the task in question, and that only. Mixing an enhancement or a bugfix with unrelated stylistic changes, adding multiple features in one PR, etc., makes it hard, if not to say impossible, to review a PR. |
Those are convincing arguments, thanks for making me aware of this. I suppose that the only case where a force push could be tolerated is when the PR is in draft state. But once it is published, it is over. |
Yes, that's correct. A draft PR is work in progress; you may do with it as you please. |
Why was this PR suddenly stopped? |
Since starting a
multiprocessing.Process
instancep
stores a weak reference atp._popen.finalizer._weakref
which makesp
unserialisable, we solve that issue by storing only the_key
of the finalizer (instead of the whole finalizer) whose mapping to the finalizer is stored in themultiprocessing.util._finalizer_registry
dictionary.Likewise, we also make started
multiprocessing.managers.BaseManager
instances serialisable.