[GH-ISSUE #492] [BUG] Archived tasks prevent new tasks being queued when using TaskID #1238

Closed
opened 2026-03-07 22:07:53 +03:00 by kerem · 3 comments
Owner

Originally created by @jt-voyager on GitHub (Jun 15, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/492

Originally assigned to: @hibiken on GitHub.

Describe the bug
If we have a task that has a TaskID, and it exhausts it's retry count, you cannot queue that task up again as it's considered a duplicate.

To Reproduce

  1. Enqueue a task with a TaskID
  2. Let it exhaust it's retry count
  3. Observe it in the archived state
  4. Try and enqueue another task with same TaskID
  5. Observe it be rejected

Expected behavior
If a task is in the archive state, we should be able to enqueue a new task with that TaskID

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: any
  • Version of asynq package: v0.23.0
Originally created by @jt-voyager on GitHub (Jun 15, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/492 Originally assigned to: @hibiken on GitHub. **Describe the bug** If we have a task that has a TaskID, and it exhausts it's retry count, you cannot queue that task up again as it's considered a duplicate. **To Reproduce** 1. Enqueue a task with a TaskID 2. Let it exhaust it's retry count 3. Observe it in the archived state 4. Try and enqueue another task with same TaskID 5. Observe it be rejected **Expected behavior** If a task is in the archive state, we should be able to enqueue a new task with that TaskID **Screenshots** If applicable, add screenshots to help explain your problem. **Environment (please complete the following information):** - OS: any - Version of `asynq` package: v0.23.0
kerem 2026-03-07 22:07:53 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@linhbkhn95 commented on GitHub (Jun 17, 2022):

hi @jt-voyager
IMO, the task is archive state which occurs due to some reasons. If it can be an internal error, network error, incorrect format data... So, It can retry unlimited but workers still perform successfully. We should process manually instead of creating new task automation. We can use asynqmon to retry archive tasks.

<!-- gh-comment-id:1158545344 --> @linhbkhn95 commented on GitHub (Jun 17, 2022): hi @jt-voyager IMO, the task is archive state which occurs due to some reasons. If it can be an internal error, network error, incorrect format data... So, It can retry unlimited but workers still perform successfully. We should process manually instead of creating new task automation. We can use [asynqmon](https://github.com/hibiken/asynqmon) to retry archive tasks.
Author
Owner

@hibiken commented on GitHub (Jun 19, 2022):

@jt-voyager Thank you for creating an issue.
This is WAI (working as intended).
If you really need to enqueue another task with the same TaskID, then I suggest using Inspector.DeleteTask to ensure that the old task with the same ID is deleted.

<!-- gh-comment-id:1159818702 --> @hibiken commented on GitHub (Jun 19, 2022): @jt-voyager Thank you for creating an issue. This is WAI (working as intended). If you really need to enqueue another task with the same TaskID, then I suggest using [`Inspector.DeleteTask`](https://pkg.go.dev/github.com/hibiken/asynq#Inspector.DeleteTask) to ensure that the old task with the same ID is deleted.
Author
Owner

@bojanz commented on GitHub (Aug 30, 2023):

@hibiken
We ran into the same problem. If nothing else, this needs a strong warning in the TaskID documentation because it prevents unique tasks from working in some cases such as ours, where the goal is to permit a single in-flight operation per entity ID.

<!-- gh-comment-id:1699087706 --> @bojanz commented on GitHub (Aug 30, 2023): @hibiken We ran into the same problem. If nothing else, this needs a strong warning in the TaskID [documentation](https://github.com/hibiken/asynq/wiki/Unique-Tasks) because it prevents unique tasks from working in some cases such as ours, where the goal is to permit a single in-flight operation per entity ID.
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#1238
No description provided.