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

Open
opened 2026-03-15 20:42:35 +03:00 by kerem · 6 comments
Owner

Originally created by @lealoureiro on GitHub (Dec 13, 2024).
Original GitHub issue: https://github.com/hibiken/asynq/issues/986

Originally assigned to: @hibiken, @kamikazechaser on GitHub.

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?

Originally created by @lealoureiro on GitHub (Dec 13, 2024). Original GitHub issue: https://github.com/hibiken/asynq/issues/986 Originally assigned to: @hibiken, @kamikazechaser on GitHub. 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?
Author
Owner

@kamikazechaser commented on GitHub (Dec 17, 2024):

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

<!-- gh-comment-id:2547564666 --> @kamikazechaser commented on GitHub (Dec 17, 2024): Could you try using ServerMux and see if the retry count is decremented.
Author
Owner

@lealoureiro commented on GitHub (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?

<!-- gh-comment-id:2549724297 --> @lealoureiro commented on GitHub (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?
Author
Owner

@kamikazechaser commented on GitHub (Dec 18, 2024):

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.

<!-- gh-comment-id:2551250647 --> @kamikazechaser commented on GitHub (Dec 18, 2024): 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.
Author
Owner

@lealoureiro commented on GitHub (Dec 18, 2024):

Same issue:
Archive queue
error message

Please let me know if you need more info

<!-- gh-comment-id:2552388553 --> @lealoureiro commented on GitHub (Dec 18, 2024): Same issue: ![Archive queue](https://i.ibb.co/qNbZ4gq/ss.png) ![error message](https://i.ibb.co/TrRgTzw/ss-000.png) Please let me know if you need more info
Author
Owner

@newarifrh commented on GitHub (Mar 29, 2025):

Same issue: Archive queue error message

Please let me know if you need more info

did you find the solution?

<!-- gh-comment-id:2763083267 --> @newarifrh commented on GitHub (Mar 29, 2025): > Same issue: ![Archive queue](https://camo.githubusercontent.com/961ba1a3c4bacc6633c4e9a4866f4b56ff9952b9e7c386711949a32db5d89dc5/68747470733a2f2f692e6962622e636f2f714e625a3467712f73732e706e67) ![error message](https://camo.githubusercontent.com/54ee26896a8c460c7f0f936bca3d01966467226b6891b7ea5f866a06c4eb0eeb/68747470733a2f2f692e6962622e636f2f54725267547a772f73732d3030302e706e67) > > Please let me know if you need more info did you find the solution?
Author
Owner

@Otetz commented on GitHub (Apr 13, 2025):

I catch this issue in case of running two asynq server instances with the same settings, but different handlers.
And didn't know how to resolve this situation.

<!-- gh-comment-id:2799531238 --> @Otetz commented on GitHub (Apr 13, 2025): I catch this issue in case of running two asynq server instances with the same settings, but different handlers. And didn't know how to resolve this situation.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asynq#2499
No description provided.