Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incorrect main thread definition in subprocess #452

Closed
horpto opened this issue Dec 6, 2021 · 0 comments · Fixed by #453
Closed

incorrect main thread definition in subprocess #452

horpto opened this issue Dec 6, 2021 · 0 comments · Fixed by #453

Comments

@horpto
Copy link
Contributor

horpto commented Dec 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant