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

Worker hangs sometimes #63

Open
s3rius opened this issue Mar 18, 2023 · 3 comments
Open

Worker hangs sometimes #63

s3rius opened this issue Mar 18, 2023 · 3 comments
Assignees
Milestone

Comments

@s3rius
Copy link
Member

s3rius commented Mar 18, 2023

Sometimes we fall into state, when taskiq worker hangs and doesn't react to signals like SIGTERM.

We need to fix it, since it's really annoying. Maybe we should differently work with child processes.

@s3rius
Copy link
Member Author

s3rius commented Mar 25, 2023

I refactored process manager and since then there were no hangs.

But I do believe that process manager can be updated, so it will react instantly to the events.

One of the proposed solutions would be:

  1. Create a separate thread, that checks if processes are dead;
  2. Remove sleep from the main process-watcher loop;
  3. Update main loop, so it blocks until new events from the queue.
  4. Remove process checking from the main loop.

Or we can come up with better solution.

@s3rius s3rius assigned s3rius and Kolaer and unassigned s3rius Mar 25, 2023
@s3rius s3rius added this to Taskiq Mar 26, 2023
@s3rius s3rius added this to the 1.0.0 milestone Mar 26, 2023
@s3rius s3rius moved this to Todo in Taskiq Mar 26, 2023
@Kolaer Kolaer moved this from Todo to In Progress in Taskiq Mar 28, 2023
@kevinhikaruevans
Copy link
Contributor

Do we know what causes this to happen? I've been experiencing it fairly often and I usually have to kill -9 the processes.

@s3rius
Copy link
Member Author

s3rius commented Mar 8, 2024

Actually it's a mystery for me. Most probably it happens because workers start before singral interceptors are called. Because I only experienced it when I was sending "^C" signal before the startup sequence was complete.

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

No branches or pull requests

3 participants