taskiq icon indicating copy to clipboard operation
taskiq copied to clipboard

Bug: worker thrashing on task startup

Open kmc-firework opened this issue 5 months ago • 2 comments

Hi there,

While trying to use TaskIQ in a specific scenario, waiting for a task to spin up resulted in constant thrashing (task killed and restarted in loop). After triaging the case, @reggie-firework and I noticed this specific line:

https://github.com/taskiq-python/taskiq/blob/master/taskiq/cli/worker/process_manager.py#L100

To us, the logic appears backwards, why wait when the task is alive? I can assume there may be additional warmup, but after inverting the logic, it resolved our issue with thrashing. @reggie-firework is more than happy to submit a PR but we wanted to bring up a discussion about it first to ensure there's no conflict and we're understanding the issue correctly.

Thank you for your time!

-ken

kmc-firework avatar Jun 09 '25 18:06 kmc-firework