Issue 5585: implement initializer for multiprocessing.BaseManager.start() (original) (raw)

Created on 2009-03-28 11:16 by lekma, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Issue5585.patch lekma,2009-03-28 11:22
Issue5585_2.patch lekma,2009-03-30 18:43
Issue5585_2_py3k.patch lekma,2009-03-31 07:12
Messages (14)
msg84302 - (view) Author: (lekma) * Date: 2009-03-28 11:16
It would be useful to have the ability to run arbitrary code before a manager's server subprocess is started (I'd use this feature to install signal handlers for example).
msg84303 - (view) Author: (lekma) * Date: 2009-03-28 11:22
here is a patch doing just that (against trunk). ps: this is my first bug report and contribution to Python, please, be gentle :)
msg84330 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-03-28 19:41
Note that the Multiprocessing docs say that the Process "follows the API of threading.Thread," and this would represent a (minor) divergence. I also note that the patch does not contain any tests.
msg84368 - (view) Author: (lekma) * Date: 2009-03-29 08:55
AFAIK there is no equivalent to the managers api in threading. As for the tests, what kind of tests would you like to see? Jesse, some thoughts on that?
msg84404 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-03-29 14:21
Right, it's just the Thread/Process API equivalance. I'm not saying it's a stopper, but the docs would probably need to be modified accordingly. As for tests, even just one that would prove that the method will be called and do something trivial would be a good thing to have, IMO.
msg84406 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-03-29 14:32
By the way, in case it isn't clear, I defer to Jesse on whether or not it makes sense to accept this :)
msg84409 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2009-03-29 14:33
I know, but tests (like the ones you outlined) would also make it more compelling
msg84609 - (view) Author: (lekma) * Date: 2009-03-30 18:43
> Right, it's just the Thread/Process API equivalance. I'm not saying > it's a stopper, but the docs would probably need to be modified > accordingly. I'm a bit confused here. The patch only adds a small feature to BaseManager and subtypes (the same way Pool does it already). AFAICT the Thread/Process API equivalence is preserved. Am I missing something? This patch should be better: - checks that initializer is a callable, raise TypeError if not (do it for Pool.__init__ also). - adds tests for Pool.__init__ and SyncManager.start
msg84754 - (view) Author: (lekma) * Date: 2009-03-31 07:12
The same against py3k. Jesse, is there any chance that this will make it in, or should I just go and implement a local solution?
msg84768 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2009-03-31 12:37
On Mar 31, 2009, at 2:12 AM, lekma <report@bugs.python.org> wrote: > > lekma <lekmalek@gmail.com> added the comment: > > The same against py3k. > > Jesse, is there any chance that this will make it in, or should I just > go and implement a local solution? > I'm thinking about it and plan on discussing it with other core devs today. Altering the Api is not something done lightly
msg84776 - (view) Author: (lekma) * Date: 2009-03-31 13:21
> I'm thinking about it and plan on discussing it with other core devs > today. Altering the Api is not something done lightly yep. Thanks for considering it.
msg84778 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-03-31 13:35
>I'm a bit confused here. The patch only adds a small feature to >BaseManager and subtypes (the same way Pool does it already). AFAICT the >Thread/Process API equivalence is preserved. Am I missing something? No, I'm the one who was missing something. I obviously didn't look at the patch carefully enough.
msg85165 - (view) Author: Jesse Noller (jnoller) * (Python committer) Date: 2009-04-02 05:18
committed in r71041 on python trunk, provided clean buildbots, we will merge to python 3.1
msg85174 - (view) Author: (lekma) * Date: 2009-04-02 06:34
thanks guys
History
Date User Action Args
2022-04-11 14:56:47 admin set github: 49835
2009-04-02 06:34:17 lekma set messages: +
2009-04-02 05🔞14 jnoller set status: open -> closedresolution: fixedmessages: +
2009-03-31 13:35:30 r.david.murray set messages: +
2009-03-31 13:21:16 lekma set messages: +
2009-03-31 12:37:28 jnoller set messages: +
2009-03-31 07:12:23 lekma set files: + Issue5585_2_py3k.patchmessages: +
2009-03-30 18:43:20 lekma set files: + Issue5585_2.patchmessages: +
2009-03-29 14:35:32 jnoller set priority: low
2009-03-29 14:33:42 jnoller set messages: +
2009-03-29 14:32:46 r.david.murray set messages: +
2009-03-29 14:21:20 r.david.murray set messages: +
2009-03-29 08:55:56 lekma set messages: +
2009-03-28 22:50:15 jnoller set assignee: jnoller
2009-03-28 19:41:20 r.david.murray set nosy: + r.david.murraymessages: + assignee: jnoller -> (no value)keywords: + patch
2009-03-28 18:59:40 jnoller set keywords: + needs review, - patchassignee: jnollernosy: + jnoller
2009-03-28 11:22:06 lekma set files: + Issue5585.patchkeywords: + patchmessages: +
2009-03-28 11:16:24 lekma create