mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #1015] [BUG] Worker failure appears to increment retry counter #2510
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#2510
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 @kmcgovern-apixio on GitHub (Jan 29, 2025).
Original GitHub issue: https://github.com/hibiken/asynq/issues/1015
Originally assigned to: @hibiken, @kamikazechaser on GitHub.
Describe the bug
When a worker fails a task will move into
archivedstate without retrying ifasynq.MaxRetries(0)is set on the task. Setting it to any positive value causes allows X worker failures. IE settingasynq.MaxRetries(3)will cause allow the task to get picked up again up to 3 times with worker failures as the causeEnvironment (please complete the following information):
asynqpackage version: 0.25.1To Reproduce
Steps to reproduce the behavior (Code snippets if applicable):
hgetall "asynq:{default}:t:8abc3be7-2f6f-4ac4-a610-1c0a23188d96"archivedstate (can check with hgetall)Expected behavior
tasks are picked back up on worker failure. retries is incremented only upon a task returning an error or panic
Screenshots
output from redis cli (payloads and job name redacted)
Additional context
For now i am bumping the max retry value to be able to handle this, but I was expecting worker failures to not impact retries
@kamikazechaser commented on GitHub (May 15, 2025):
https://github.com/hibiken/asynq/blob/master/recoverer.go#L99
Possibly related to the above.
Looks like an edge case. We could handle this.
@kamikazechaser commented on GitHub (May 15, 2025):
@kmcgovern-apixio Try using the sohail/recoverer-fix branch and see if it fixes your issue.
@dmitrii-doronin commented on GitHub (Dec 29, 2025):
@kamikazechaser, hi. Thank you for taking a look at the issue. Appreciate it.
It seems that the proposed solution would lead to worker failures to always be retried. What's your opinion on introducing
isRetryableFuncor something similar to allow for more granular control here? It might not even be a breaking change if the library provides a default retry function through the options.If there's a more appropriate way to handle the case in this thread, I would be really glad if you could point it out.