Skip to content

asyncio: support multiprocessing (support fork) #66285

@danoreilly

Description

@danoreilly
BPO 22087
Nosy @gvanrossum, @pitrou, @1st1, @thehesiod, @miss-islington
PRs
  • bpo-22087: Fix Policy.get_event_loop() to detect fork #7208
  • [3.7] bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208) #7215
  • [3.6] bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208) #7218
  • bpo-22087: Restructure code to be more robust and safe #7226
  • Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" #7232
  • Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" #7233
  • Files
  • test_loop.py: Test script demonstrating the issue
  • handle_mp_unix.diff: Patch that makes _UnixDefaultEventLoopPolicy create a new loop object if get_event_loop is called in a forked mp child process
  • handle-mp_unix2.patch: Use os.getpid() instead of multiprocessing. Store pid state in Policy instance rather than the Loop instance.
  • handle_mp_unix_with_test.diff: Adds a unit test to previous 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 = None
    created_at = <Date 2014-07-26.18:01:10.150>
    labels = ['type-bug', 'expert-asyncio']
    title = 'asyncio: support multiprocessing (support fork)'
    updated_at = <Date 2018-05-30.00:56:36.541>
    user = 'https://bugs.python.org/danoreilly'

    bugs.python.org fields:

    activity = <Date 2018-05-30.00:56:36.541>
    actor = 'yselivanov'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['asyncio']
    creation = <Date 2014-07-26.18:01:10.150>
    creator = 'dan.oreilly'
    dependencies = []
    files = ['36117', '36118', '36119', '36134']
    hgrepos = []
    issue_num = 22087
    keywords = ['patch']
    message_count = 23.0
    messages = ['224082', '224084', '224085', '224097', '224125', '224140', '224143', '224144', '224145', '226698', '235404', '235411', '288327', '297222', '297226', '297227', '297229', '318077', '318092', '318135', '318140', '318143', '318144']
    nosy_count = 7.0
    nosy_names = ['gvanrossum', 'pitrou', 'zmedico', 'yselivanov', 'thehesiod', 'dan.oreilly', 'miss-islington']
    pr_nums = ['7208', '7215', '7218', '7226', '7232', '7233']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue22087'
    versions = ['Python 3.4', 'Python 3.5', 'Python 3.6']

    Linked PRs

    Metadata

    Metadata

    Projects

    Status

    Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions