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

multiprocessing.get_all_start_methods() wrong default on macOS #83425

Closed
stefanholek mannequin opened this issue Jan 7, 2020 · 9 comments
Closed

multiprocessing.get_all_start_methods() wrong default on macOS #83425

stefanholek mannequin opened this issue Jan 7, 2020 · 9 comments
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@stefanholek
Copy link
Mannequin

stefanholek mannequin commented Jan 7, 2020

BPO 39244
Nosy @pitrou, @taleinat, @applio, @miss-islington, @idomic
PRs
  • bpo-39244: multiprocessing get all start methods #18529
  • bpo-39244: multiprocessing get all start methods #18625
  • [3.9] bpo-39244: multiprocessing return default start method first on macOS (GH-18625) #20431
  • [3.8] bpo-39244: multiprocessing return default start method first on macOS (GH-18625) #20432
  • 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-05-26.14:56:17.976>
    created_at = <Date 2020-01-07.11:54:46.917>
    labels = ['easy', 'type-bug', '3.8', '3.9', '3.10', 'library']
    title = 'multiprocessing.get_all_start_methods() wrong default on macOS'
    updated_at = <Date 2020-05-26.15:14:04.838>
    user = 'https://bugs.python.org/stefanholek'

    bugs.python.org fields:

    activity = <Date 2020-05-26.15:14:04.838>
    actor = 'miss-islington'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-26.14:56:17.976>
    closer = 'taleinat'
    components = ['Library (Lib)']
    creation = <Date 2020-01-07.11:54:46.917>
    creator = 'stefanholek'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 39244
    keywords = ['patch', 'newcomer friendly']
    message_count = 9.0
    messages = ['359503', '362097', '362104', '362517', '369839', '369990', '369992', '369997', '369998']
    nosy_count = 6.0
    nosy_names = ['pitrou', 'taleinat', 'stefanholek', 'davin', 'miss-islington', 'Ido Michael']
    pr_nums = ['18529', '18625', '20431', '20432']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue39244'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @stefanholek
    Copy link
    Mannequin Author

    stefanholek mannequin commented Jan 7, 2020

    In Python 3.8 the default start method has changed from fork to spawn on macOS.
    https://docs.python.org/3/whatsnew/3.8.html#multiprocessing

    get_all_start_methods() says: "Returns a list of the supported start methods, the first of which is the default."
    https://docs.python.org/3/library/multiprocessing.html?highlight=finalize#multiprocessing.get_all_start_methods

    However, it appears to still return fork as default:

      Python 3.8.1 (default, Dec 22 2019, 03:45:23) 
      [Clang 10.0.1 (clang-1001.0.46.4)] on darwin
      Type "help", "copyright", "credits" or "license" for more information.
      >>> import multiprocessing
      >>> multiprocessing.get_all_start_methods()
      ['fork', 'spawn', 'forkserver']
      >>> 

    Thank you!

    @stefanholek stefanholek mannequin added OS-mac 3.8 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 7, 2020
    @ned-deily ned-deily added 3.9 only security fixes and removed OS-mac labels Jan 7, 2020
    @taleinat
    Copy link
    Contributor

    Good catch, Stefen!

    This seems like we forgot to update multiprocessing.get_all_start_methods() when making the change to make "spawn" the default on macOS. I suggest updating it accordingly.

    @idomic
    Copy link
    Mannequin

    idomic mannequin commented Feb 16, 2020

    Fixed the bug to default any macos into 'spawn'
    PR: #62729

    @idomic
    Copy link
    Mannequin

    idomic mannequin commented Feb 23, 2020

    Created a new clean PR #62825

    @idomic
    Copy link
    Mannequin

    idomic mannequin commented May 24, 2020

    Fixed Tal's comments, I took the darwin if check out of the reduction.HAVE_SEND_HANDLE, also fixed the test

    @taleinat taleinat added 3.10 only security fixes labels May 26, 2020
    @taleinat
    Copy link
    Contributor

    New changeset db098bc by idomic in branch 'master':
    bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
    db098bc

    @taleinat
    Copy link
    Contributor

    Thanks for fixing this, Ido!

    @miss-islington
    Copy link
    Contributor

    New changeset 1c88bf8 by Miss Islington (bot) in branch '3.9':
    bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
    1c88bf8

    @miss-islington
    Copy link
    Contributor

    New changeset 285ff63 by Miss Islington (bot) in branch '3.8':
    bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
    285ff63

    @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
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes easy stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants