Skip to content

Use new _at_fork_reinit() lock method in multiprocessing #84402

Closed

Description

@vstinner
BPO 40221
Nosy @vstinner, @corona10, @shihai1991
PRs
  • bpo-40221: Update ForkAwareThreadLock to use _at_fork_reinit #19477
  • bpo-40221: Update multiprocessing to use _at_fork_reinit #19511
  • 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 2020-04-14.16:38:40.314>
    created_at = <Date 2020-04-07.23:03:53.125>
    labels = ['type-feature', 'library', '3.9']
    title = 'Use new _at_fork_reinit() lock method in multiprocessing'
    updated_at = <Date 2020-04-14.16:38:40.313>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-04-14.16:38:40.313>
    actor = 'corona10'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-04-14.16:38:40.314>
    closer = 'corona10'
    components = ['Library (Lib)']
    creation = <Date 2020-04-07.23:03:53.125>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40221
    keywords = ['patch']
    message_count = 6.0
    messages = ['365957', '366205', '366207', '366386', '366399', '366400']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'corona10', 'shihai1991']
    pr_nums = ['19477', '19511']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue40221'
    versions = ['Python 3.9']

    Activity

    1. vstinner commented on Apr 7, 2020

      @vstinner
      MemberAuthor

      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.

    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      on Apr 7, 2020
    3. corona10 commented on Apr 11, 2020

      @corona10
      Member

      I am going to take a look

    4. corona10 commented on Apr 11, 2020

      @corona10
      Member

      we should find all usages from Lib/multiprocessing/*.py

    5. corona10 commented on Apr 14, 2020

      @corona10
      Member

      New changeset e194530 by Dong-hee Na in branch 'master':
      bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19477)
      e194530

    6. corona10 commented on Apr 14, 2020

      @corona10
      Member

      New changeset a5900ec by Dong-hee Na in branch 'master':
      bpo-40221: Update multiprocessing to use _at_fork_reinit (GH-19511)
      a5900ec

    7. corona10 commented on Apr 14, 2020

      @corona10
      Member

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

    8. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.9 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions