mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #363] [FEATURE REQUEST] retry policy enhancement #1173
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#1173
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 @sersh88 on GitHub (Dec 8, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/363
Originally assigned to: @hibiken on GitHub.
Feature request about retry policy.
Sometimes, when doing a task, it is clear that it will not be possible to complete it even on subsequent attempts.
So, it will be useful for a task handler to return special error type after which the task will be completely failed and no retries will be processed.
Also another enhancement is to be able to modify task payload in task handler. It's useful in some batch tasks, if I need to process i.e. 100 files and succeffully processed 99 of them, 1 was failed due to temporary network problem, so will be great if on next retry attempt task handler could use modifed payload with only 1 item to process.
@crossworth commented on GitHub (Dec 8, 2021):
Hello, you can already handle the error in different ways, see:
https://github.com/hibiken/asynq/wiki/Task-Retry#skip-retry
About changing the task payload, I don't is possible right now, but you can get the same result by enqueuing a new task with the payload changed and returning a skip retry on the task.
@sersh88 commented on GitHub (Dec 8, 2021):
Thanks, somehow I missed this SkipRetry error.
@hibiken commented on GitHub (Dec 8, 2021):
@sersh88 thank you for creating this issue and thank you @crossworth for jumping in!
For the first question, please see @crossworth's comment above.
For the second question, payload should be immutable IMO. We introduced task
Resultin v0.19. you could probably write your partial result and read the result in the subsequent attempts.Example: