Skip to content

Multiprocessing hanging #1854

@avhz

Description

@avhz

I have a Python library that does some multiprocessing like:

with multiprocessing.Pool(n) as pool:
    results = pool.map(f, stuff)

It runs fine if I use the library from Python, but when I run it in R via reticulate, it just hangs.

I have not been able to reproduce it minimally, however I found that if I add the following prior to the call, it runs successfully:

mp <- reticulate::import("multiprocessing", delay_load = TRUE)

mp$set_start_method('spawn', force = TRUE)

Is this a known issue, with any solutions aside from setting the start method ?

I am in an Ubuntu (v24.04) container on a RHEL (v9.6) host, if that helps.

I am trying to get a reprex, if I manage I will add it.

Edit:

Reticulate version: 1.43.0
R version: 4.5.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions