Skip to content

Hypercorn processes daemon property fails multiprocessing.Process / concurrent.futures.ProcessPoolExecutor #245

@umairanis03

Description

@umairanis03

Hypercorn worker processes are by default run with daemon set (ref). This prevents APIs like multiprocessing.Process / concurrent.futures.ProcessPoolExecutor from creating children processes from inside the application.

  ...  File "<decorator-gen-995>", line 4, in wrapped_function_illegal_multiprocessing
  ...  File "/codemill/asthanas/dpi/sample.py", line 94, in illegal_multiprocessing
    daemon_process.start()
  File "/opt/python/python-3.11/lib64/python3.11/multiprocessing/process.py", line 118, in start
    assert not _current_process._config.get('daemon'), \

AssertionError:daemonic processes are not allowed to have children

Is there any reason why worker processes need to be daemonized or if this flag could be configured? Note that, this is not the case with application servers like uWSGI or uvicorn.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions