[GH-ISSUE #1071] [BUG] Some tasks are processed prior to scheduled time #2533

Open
opened 2026-03-15 20:48:39 +03:00 by kerem · 0 comments
Owner

Originally created by @arunmittalmrsool on GitHub (Sep 2, 2025).
Original GitHub issue: https://github.com/hibiken/asynq/issues/1071

Originally assigned to: @hibiken, @kamikazechaser on GitHub.

Describe the bug
Asynq works at a precision of seconds
If currentTime is 2025-08-27 16:25:16.871255 and ProcessTime is 10 seconds, then that task will be processAt 2025-08-27 16:25:26 but not at 2025-08-27 16:25:26.871255 OR 2025-08-27 16:25:27 due to https://github.com/hibiken/asynq/blob/master/internal/rdb/rdb.go#L677 (here we are storing processAt in Unix() precision, which missed extra .871255 seconds)

If user want that task to be processed only after X sec, not before that, then it can cause problem for their use case. Due to that we are missing some tasks processing.

Environment (please complete the following information):

  • OS: MacOS, Linux
  • asynq package version [e.g. v0.25.0]
  • Redis/Valkey version

To Reproduce
Steps to reproduce the behavior (Code snippets if applicable):

  1. Mentioned in description

Expected behavior
It should process that only after expected time.

Originally created by @arunmittalmrsool on GitHub (Sep 2, 2025). Original GitHub issue: https://github.com/hibiken/asynq/issues/1071 Originally assigned to: @hibiken, @kamikazechaser on GitHub. **Describe the bug** Asynq works at a precision of seconds If currentTime is 2025-08-27 16:25:16.871255 and ProcessTime is 10 seconds, then that task will be processAt 2025-08-27 16:25:26 but not at 2025-08-27 16:25:26.871255 OR 2025-08-27 16:25:27 due to https://github.com/hibiken/asynq/blob/master/internal/rdb/rdb.go#L677 (here we are storing processAt in Unix() precision, which missed extra **.871255** seconds) If user want that task to be processed only after X sec, not before that, then it can cause problem for their use case. Due to that we are missing some tasks processing. **Environment (please complete the following information):** - OS: MacOS, Linux - `asynq` package version [e.g. v0.25.0] - Redis/Valkey version **To Reproduce** Steps to reproduce the behavior (Code snippets if applicable): 1. Mentioned in description **Expected behavior** It should process that only after expected time.
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#2533
No description provided.