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

[Question] Can worker avoid pick tasks for which does not have handler? #986

Open
lealoureiro opened this issue Dec 13, 2024 · 4 comments
Open
Assignees
Labels
enhancement New feature or request investigate

Comments

@lealoureiro
Copy link

Hello,

I would like to check if it is expected behavior or if there is a way to change it.

I noticed if I connect a worker/consumer to the default queue that does not have implemented a handler for a certain pattern/task type, it still tries to consume the task and then puts back in queue incrementing the retry count and eventually exhaust all the retries.

Is expected that all workers connected to asynq on certain Redis instance, should be able to handle all types of tasks?

There might be some cases where some workers might interested in some kind of tasks and other in different ones. What should be the pattern to implement such use case? Different Redis instance? Different DB? Different queue names?

@lealoureiro lealoureiro added the enhancement New feature or request label Dec 13, 2024
@kamikazechaser
Copy link
Collaborator

Could you try using ServerMux and see if the retry count is decremented.

@lealoureiro
Copy link
Author

lealoureiro commented Dec 17, 2024

I believe I'm already using the ServerMux:(https://gitlab.com/lealoureiro/jax-eda-go/-/blob/main/webhookworker/webhookworker.go?ref_type=heads
Line 99.

The error:
https://ibb.co/J5RzTLL

Because of the way that Redis works, asynq always needs to pick the task/object from redis and then put back correct?

@kamikazechaser
Copy link
Collaborator

Before I run that code to investigate further, could you debug with the inspector/CLI? This kind of issue usually comes about because of incorrect use of the library (based on the previous issues reporting something similar).

Post the results of queue info and servers.

@lealoureiro
Copy link
Author

Same issue:
Archive queue
error message

Please let me know if you need more info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request investigate
Projects
None yet
Development

No branches or pull requests

3 participants