mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #221] [FEATURE REQUEST] Allow handlers to fail a task permanently (no retry) #2106
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#2106
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 @bojanz on GitHub (Jan 6, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/221
Originally assigned to: @hibiken on GitHub.
Is your feature request related to a problem? Please describe.
Asynq supports automatically retrying tasks. In some cases, it is obvious to the handler that a task can't ever be completed successfully. The handler currently has two ways to handle this:
Returning nil has the downside of not keeping the task "dead", so it becomes invisible to the CLI and the future web UI.
Describe the solution you'd like
I'd like to be able to return an error such as asynq.NoRetryError(msg) which would stop execution and mark the task as dead.
Describe alternatives you've considered
Returning nil and flipping a "permanently failed" boolean on the object being processed works as an alternative. This feature request is a "nice to have", but feels reasonable for a queue to support.
@hibiken commented on GitHub (Jan 6, 2021):
@bojanz Thank you for opening this issue, this is definitely much-needed feature.
The solution you suggested sounds reasonable to me.
Handlercan return some sentinel error type to indicate that the task doesn't need to be retried.I'll include this change in the next version release (should be in a week or two if all goes well).
@hibiken commented on GitHub (Jan 14, 2021):
Closed via #226