uvloop icon indicating copy to clipboard operation
uvloop copied to clipboard

incorrect main thread definition in subprocess

Open horpto opened this issue 4 years ago • 0 comments

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

horpto avatar Dec 06 '21 16:12 horpto