This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: implement initializer for multiprocessing.BaseManager.start()
Type: enhancement Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: jnoller Nosy List: jnoller, lekma, r.david.murray
Priority: low Keywords: needs review, patch

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:47adminsetgithub: 49835
2009-04-02 06:34:17lekmasetmessages: + msg85174
2009-04-02 05:18:14jnollersetstatus: open -> closed
resolution: fixed
messages: + msg85165
2009-03-31 13:35:30r.david.murraysetmessages: + msg84778
2009-03-31 13:21:16lekmasetmessages: + msg84776
2009-03-31 12:37:28jnollersetmessages: + msg84768
2009-03-31 07:12:23lekmasetfiles: + Issue5585_2_py3k.patch

messages: + msg84754
2009-03-30 18:43:20lekmasetfiles: + Issue5585_2.patch

messages: + msg84609
2009-03-29 14:35:32jnollersetpriority: low
2009-03-29 14:33:42jnollersetmessages: + msg84409
2009-03-29 14:32:46r.david.murraysetmessages: + msg84406
2009-03-29 14:21:20r.david.murraysetmessages: + msg84404
2009-03-29 08:55:56lekmasetmessages: + msg84368
2009-03-28 22:50:15jnollersetassignee: jnoller
2009-03-28 19:41:20r.david.murraysetnosy: + r.david.murray
messages: + msg84330

assignee: jnoller -> (no value)
keywords: + patch
2009-03-28 18:59:40jnollersetkeywords: + needs review, - patch
assignee: jnoller

nosy: + jnoller
2009-03-28 11:22:06lekmasetfiles: + Issue5585.patch
keywords: + patch
messages: + msg84303
2009-03-28 11:16:24lekmacreate