Skip to content

incorrect main thread definition in subprocess #452

Closed
@horpto

Description

@horpto

Hi, I have program with main process and a bunch subprocesses. Main process sends tasks via pipe to some subprocesses. Each subprocess are getting task synchronously in a separate thread and then process (send http query) in main thread of subprocess. I wanted to make add_signal_handler in main thread of each subprocess. But I got ValueError: add_signal_handler() can only be called from the main thread with uvloop. Asyncio works correctly. I think the main problem in MAIN_THREAD_ID. It's initialized only once.

  • uvloop version: 0.16.0

  • Python version: 3.8.10

  • Platform: Linux devvoip 5.4.0-91-generic #102-Ubuntu SMP Fri Nov 5 16:31:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

  • Can you reproduce the bug with PYTHONASYNCIODEBUG in env?: yes

  • Does uvloop behave differently from vanilla asyncio? How?: uvloop raises ValueError, asyncio works fine

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