Skip to content

Hanging when using python multiprocessing along with dask.distributed #5596

@YarShev

Description

@YarShev

What happened:

I encountered hanging when using python multiprocessing along with dask.distributed (nested parallelism);

What you expected to happen:

I wonder whether that should work.

Minimal Complete Verifiable Example:

if __name__ == '__main__':
    from distributed import Client
    client = Client()

    import pandas
    df = pandas.DataFrame([1])
    fut = client.scatter(df)

    def f(obj):
        local_df = client.gather(fut)
        local_df += obj

    from multiprocessing import Pool

    with Pool(5) as p:
        print(p.map(f, [1]))

Environment:

  • Dask version: dask 2021.11.2 pyhd8ed1ab_0 conda-forge
  • Python version: Python 3.8.12
  • Operating System: Ubuntu 20.04.2
  • Install method (conda, pip, source): conda

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs infoNeeds further information from the user

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions