mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 15:35:55 +03:00
[GH-ISSUE #628] [QUESTION] is it possible to run different instances of asynq with same redis URL #2332
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#2332
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 @TheDhejavu on GitHub (Mar 17, 2023).
Original GitHub issue: https://github.com/hibiken/asynq/issues/628
Originally assigned to: @hibiken on GitHub.
Question
i have two workers running different instances pointing to same redis URL , i did this but i noticed a weird clash between this instances.
For example:
A registered handler throws
Last Failure: handler not found for taskin one instance while the other instance work but lags.Instance 1
Instance 2
I get this error in instance 2 with
Last Failure: handler not found for taskWhat do you think?
@bfwbbrj commented on GitHub (Mar 28, 2023):
Did you specify Queues when you start up your service? Currently if you didn't do this, Default Queue Config will be used. And this will result in all instances fetching job from the same queue, thus causing your problem.
I personally believe this is better solved by adding the option to set prefix when starting new asynq instance, so that different instances can safely share the same redis instance. However, this will require some code changes. The alternative way to solve this is to set unique queue config for unique set of instance(s), so that tasks will be fetched by the correct asynq instance.
Note that if you choose the alternative solution, the inspector will show the collection of all queues.
@TheDhejavu commented on GitHub (Mar 29, 2023):
Hi @bfwbbrj , thank you , i was able to solve this using queues but i will rather like to have different instances with an option to set a prefix with different priority queues. This seems like a better solution to me.
@bfwbbrj commented on GitHub (Mar 30, 2023):
I can open a pr for this once I have time. But since @hibiken has been busy recently, I'm not sure when will the pr be reviewed and merged.