classification
Title: Use new _at_fork_reinit() lock method in multiprocessing
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, shihai1991, vstinner
Priority: normal Keywords: patch

Created on 2020-04-07 23:03 by vstinner, last changed 2020-04-14 16:38 by corona10. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 19477 merged corona10, 2020-04-11 18:05
PR 19511 merged corona10, 2020-04-14 15:26
Messages (6)
msg365957 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-04-07 23:03
Currently, _ResourceSharer._after_fork() of multiprocessing.resource_sharer creates new locks and leak old locks on purpose. This method can benefit of the newly added _at_fork_reinit() method added by bpo-40089.

Queue._after_fork() could also call self._notempty._at_fork_reinit().

Also: ForkAwareThreadLock could reinitializes its lock.
msg366205 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-04-11 12:09
I am going to take a look
msg366207 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-04-11 12:10
we should find all usages from Lib/multiprocessing/*.py
msg366386 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-04-14 13:16
New changeset e1945307d36849f8be8937144cf3dd6ebab6274c by Dong-hee Na in branch 'master':
bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19477)
https://github.com/python/cpython/commit/e1945307d36849f8be8937144cf3dd6ebab6274c
msg366399 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-04-14 16:35
New changeset a5900ecf9f22e65bef489633692e9ea6941379c5 by Dong-hee Na in branch 'master':
bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19511)
https://github.com/python/cpython/commit/a5900ecf9f22e65bef489633692e9ea6941379c5
msg366400 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-04-14 16:38
Looks like we update all the methods which are related to _after_fork
under Lib/multiprocessing.

I am now closing this issue.
Thanks for the suggestion, Victor :)
History
Date User Action Args
2020-04-14 16:38:40corona10setstatus: open -> closed
type: enhancement
messages: + msg366400

resolution: fixed
stage: patch review -> resolved
2020-04-14 16:35:43corona10setmessages: + msg366399
2020-04-14 15:26:45corona10setpull_requests: + pull_request18864
2020-04-14 13:16:01corona10setmessages: + msg366386
2020-04-12 10:58:55shihai1991setnosy: + shihai1991
2020-04-11 18:05:17corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request18831
2020-04-11 12:10:03corona10setmessages: + msg366207
2020-04-11 12:09:18corona10setmessages: + msg366205
2020-04-10 13:41:40corona10setnosy: + corona10
2020-04-07 23:03:53vstinnercreate