[GH-ISSUE #275] [BUG] Deleted tasks are preventing new tasks from being enqueued #1122

Closed
opened 2026-03-07 22:06:05 +03:00 by kerem · 5 comments
Owner

Originally created by @nilam-sorathia on GitHub (Jun 4, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/275

Originally assigned to: @hibiken on GitHub.

Describe the bug
When a unique task is scheduled and then subsequently deleted with an outstanding ttl, that task prevents a new task from being enqueued until the ttl expires.

Note: the task was deleted using Asynqmon

To Reproduce

  1. Schedule a task in an hour with any payload with unique option (ttl: long enough to reproduce the bug, eg. 2 minutes)
  2. Using Asynqmon, confirm the task is in scheduled state
  3. Select the task using the Asynqmon UI and delete the task
  4. Schedule a new task with the same payload and params (unique, processedIn, queue, etc..) before the ttl of the prior task would have expired
  5. Receive duplicate task error

Expected behavior
When a task is deleted, the unique constraint of a new task should not conflict with the deleted task regardless if the deleted task's unique ttl is still outstanding. Instead the new task should be to be enqueued/scheduled without error.

Environment

  • OS: [MacOS, Linux]
  • Version of asynq package
    asynq: v0.16.0
    asynqmon: v0.1-beta1
Originally created by @nilam-sorathia on GitHub (Jun 4, 2021). Original GitHub issue: https://github.com/hibiken/asynq/issues/275 Originally assigned to: @hibiken on GitHub. **Describe the bug** When a unique task is scheduled and then subsequently deleted with an outstanding ttl, that task prevents a new task from being enqueued until the ttl expires. _Note: the task was deleted using Asynqmon_ **To Reproduce** 1. Schedule a task in an hour with any payload with unique option (ttl: long enough to reproduce the bug, eg. 2 minutes) 2. Using Asynqmon, confirm the task is in scheduled state 3. Select the task using the Asynqmon UI and delete the task 4. Schedule a new task with the same payload and params (unique, processedIn, queue, etc..) before the ttl of the prior task would have expired 5. Receive duplicate task error **Expected behavior** When a task is deleted, the unique constraint of a new task should not conflict with the deleted task regardless if the deleted task's unique ttl is still outstanding. Instead the new task should be to be enqueued/scheduled without error. **Environment** - OS: [MacOS, Linux] - Version of `asynq` package asynq: v0.16.0 asynqmon: v0.1-beta1
kerem 2026-03-07 22:06:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@hibiken commented on GitHub (Jun 5, 2021):

@nilam-sorathia Thank you for reporting this bug! I completely overlooked this, I'll fix this in the next few days.
Thank you again for spotting and reporting this bug 🙏

<!-- gh-comment-id:855174129 --> @hibiken commented on GitHub (Jun 5, 2021): @nilam-sorathia Thank you for reporting this bug! I completely overlooked this, I'll fix this in the next few days. Thank you again for spotting and reporting this bug 🙏
Author
Owner

@nilam-sorathia commented on GitHub (Jun 5, 2021):

Thank you for the quick reply. We appreciate your investment in this library and we plan on depending on it more. Would you please update this thread on whether the fix will be in asynq or asynqmon. Thank you @hibiken

<!-- gh-comment-id:855229050 --> @nilam-sorathia commented on GitHub (Jun 5, 2021): Thank you for the quick reply. We appreciate your investment in this library and we plan on depending on it more. Would you please update this thread on whether the fix will be in asynq or asynqmon. Thank you @hibiken
Author
Owner

@hibiken commented on GitHub (Jun 6, 2021):

The main fix is going to be in this asynq repo, but we'll also need to update the dependency version in asynqmon repo as well. I'll make sure to close this issue when both of these are addressed 👍

<!-- gh-comment-id:855320444 --> @hibiken commented on GitHub (Jun 6, 2021): The main fix is going to be in this `asynq` repo, but we'll also need to update the dependency version in `asynqmon` repo as well. I'll make sure to close this issue when both of these are addressed 👍
Author
Owner

@hibiken commented on GitHub (Jun 6, 2021):

The bug is fixed now. Upgrading to the latest version 0.1-beta2 of asynqmon should fix the issue 👍
Please let me know if you are still seeing the bug!

<!-- gh-comment-id:855407598 --> @hibiken commented on GitHub (Jun 6, 2021): The bug is fixed now. Upgrading to the latest version `0.1-beta2` of `asynqmon` should fix the issue 👍 Please let me know if you are still seeing the bug!
Author
Owner

@nilam-sorathia commented on GitHub (Jun 6, 2021):

@hibiken Very much appreciated!

<!-- gh-comment-id:855414721 --> @nilam-sorathia commented on GitHub (Jun 6, 2021): @hibiken Very much appreciated!
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#1122
No description provided.