mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[GH-ISSUE #586] [BUG] Unable to route the task to the correct worker #1299
Labels
No labels
CLI
bug
designing
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
idea
invalid
investigate
needs-more-info
performance
pr-welcome
pull-request
question
wontfix
work in progress
work in progress
work-around-available
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/asynq#1299
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @s0und0fs1lence on GitHub (Dec 14, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/586
Originally assigned to: @hibiken on GitHub.
Describe the bug
Hi, i'm using asynq with 3 worker servers, and all work fine.
Now i'm trying to add a 4° server to the cluster, but this server process different type of tasks.
I'm noticing that sometimes (actually really often), when i enqueue a new task that could be handled only by the new worker, the task actually goes scheduled by one of the "old" workers; this is problematic because i want this new tasks to go only in the servers that can handle them.
Also the problem is also in the opposite direction because sometimes, a "old" task goes into new server and the problem is the same;
To Reproduce
Steps to reproduce the behavior (Code snippets if applicable):
Expected behavior
The task should be scheduled only on the servers that can handle the task. This could be achieved by labeling the workers and giving the ability to the client to specifiy a worker label when enqueuing, or by trying all the servers in the cluster untill one accept the task or all refuse it.
Screenshots

Environment (please complete the following information):
asynqpackage v0.23.0@hibiken commented on GitHub (Dec 18, 2022):
You should create a separate queue for each task type and configure worker server to subscribe to appropriate queue(s).
Example:
On the worker server side, you configure it accordingly:
Please let me know if you have additional questions :)
@s0und0fs1lence commented on GitHub (Dec 20, 2022):
Thank you,
whit this approach actually i solved my problem;
Is it possible to add this information in the wiki? if it was there i could have figured this out without opening an issue.
Thanks, and congratulation for the awesome tool you developed!