mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-25 23:15:51 +03:00
[GH-ISSUE #306] [BUG] Scheduler enqueuing tasks too many times #125
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#125
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 @JeremyCraven on GitHub (Aug 4, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/306
Originally assigned to: @hibiken on GitHub.
Describe the bug
This may not be a bug, but I'm opening this so hopefully I can understand this behavior. Running asynq 0.16.
I have a periodic task with the following cron spec
* 0 * * *. I would expect this to enqueue 1 task in a 24 hour period. Looking at the history in the UI the task got enqueued 22 times in a short period of time and then stopped getting enqueued. Attached are screenshots showing the behavior observed. Hopefully this is just user error, but I'd appreciate any guidance. Thanks!To Reproduce
I'm not sure if I can reproduce this, but it has happened on multiple occasions.
* 0 * * *Expected behavior
This task should be enqueued once a day according to the cron spec.
Environment (please complete the following information):
Screenshots

@crossworth commented on GitHub (Aug 4, 2021):
Hello @JeremyCraven.
I think I see the problem:
* 0 * * *you are tellingAt every minute past hour 0.The uniqueness lock has a TTL associated with it to avoid holding the lock forever. The lock will be released after the TTL or if the task holding the lock gets processed successfully before the TTL.Is possible that you enqueue the task, but it gets processed in a few seconds and the scheduler adds it back to the queue since the unique lock is released?
Maybe changing to
0 0 * * *- At 00:00 solves the problem.@JeremyCraven commented on GitHub (Aug 4, 2021):
Thanks! Definitely user error. Closing this out. Appreciate the quick response!