Skip to content
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

implement initializer for multiprocessing.BaseManager.start() #49835

Closed
lekma mannequin opened this issue Mar 28, 2009 · 14 comments
Closed

implement initializer for multiprocessing.BaseManager.start() #49835

lekma mannequin opened this issue Mar 28, 2009 · 14 comments
Labels
stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@lekma
Copy link
Mannequin

lekma mannequin commented Mar 28, 2009

BPO 5585
Nosy @bitdancer, @lekma
Files
  • Issue5585.patch
  • Issue5585_2.patch
  • Issue5585_2_py3k.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2009-04-02.05:18:14.264>
    created_at = <Date 2009-03-28.11:16:24.644>
    labels = ['type-feature', 'library']
    title = 'implement initializer for multiprocessing.BaseManager.start()'
    updated_at = <Date 2009-04-02.06:34:16.971>
    user = 'https://github.com/lekma'

    bugs.python.org fields:

    activity = <Date 2009-04-02.06:34:16.971>
    actor = 'lekma'
    assignee = 'jnoller'
    closed = True
    closed_date = <Date 2009-04-02.05:18:14.264>
    closer = 'jnoller'
    components = ['Library (Lib)']
    creation = <Date 2009-03-28.11:16:24.644>
    creator = 'lekma'
    dependencies = []
    files = ['13438', '13478', '13508']
    hgrepos = []
    issue_num = 5585
    keywords = ['patch', 'needs review']
    message_count = 14.0
    messages = ['84302', '84303', '84330', '84368', '84404', '84406', '84409', '84609', '84754', '84768', '84776', '84778', '85165', '85174']
    nosy_count = 3.0
    nosy_names = ['jnoller', 'r.david.murray', 'lekma']
    pr_nums = []
    priority = 'low'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue5585'
    versions = []

    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Mar 28, 2009

    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).

    @lekma lekma mannequin added stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 28, 2009
    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Mar 28, 2009

    here is a patch doing just that (against trunk).
    ps: this is my first bug report and contribution to Python, please, be
    gentle :)

    @jnoller jnoller mannequin self-assigned this Mar 28, 2009
    @bitdancer
    Copy link
    Member

    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.

    @jnoller jnoller mannequin self-assigned this Mar 28, 2009
    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Mar 29, 2009

    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?

    @bitdancer
    Copy link
    Member

    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.

    @bitdancer
    Copy link
    Member

    By the way, in case it isn't clear, I defer to Jesse on whether or not
    it makes sense to accept this :)

    @jnoller
    Copy link
    Mannequin

    jnoller mannequin commented Mar 29, 2009

    I know, but tests (like the ones you outlined) would also make it more
    compelling

    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Mar 30, 2009

    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

    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Mar 31, 2009

    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?

    @jnoller
    Copy link
    Mannequin

    jnoller mannequin commented Mar 31, 2009

    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

    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Mar 31, 2009

    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.

    @bitdancer
    Copy link
    Member

    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.

    @jnoller
    Copy link
    Mannequin

    jnoller mannequin commented Apr 2, 2009

    committed in r71041 on python trunk, provided clean buildbots, we will
    merge to python 3.1

    @jnoller jnoller mannequin closed this as completed Apr 2, 2009
    @lekma
    Copy link
    Mannequin Author

    lekma mannequin commented Apr 2, 2009

    thanks guys

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant