[GH-ISSUE #799] [BUG] Lease expiration occasionally occurs when dealing with extremely long tasks,log >>> asynq: task lease expired #393

Open
opened 2026-03-02 05:20:54 +03:00 by kerem · 2 comments
Owner

Originally created by @wenlng on GitHub (Dec 30, 2023).
Original GitHub issue: https://github.com/hibiken/asynq/issues/799

Originally assigned to: @hibiken on GitHub.

When dealing with a very long task, the lease will occasionally expire, resulting in the task being canceled before it is completed, context canceled

To Reproduce
taskInfo, err := asynqClient.Enqueue(
asynq.NewTask("SyncDataTask", payload),
asynq.Timeout(time.Second*3600), // The timeout period of the task is set to 1 hour
)

Expected behavior
The task takes about half an hour to complete, after several tests, in the process of processing occasionally occurs asynq: task lease expired, resulting in the task is terminated, hope the author pay attention to this problem, thank you!

Screenshots
...

Environment (please complete the following information):

  • OS: MacOS or Linux
  • Version of asynq package v0.24.1

Additional context
....

Originally created by @wenlng on GitHub (Dec 30, 2023). Original GitHub issue: https://github.com/hibiken/asynq/issues/799 Originally assigned to: @hibiken on GitHub. When dealing with a very long task, the lease will occasionally expire, resulting in the task being canceled before it is completed, context canceled **To Reproduce** taskInfo, err := asynqClient.Enqueue( asynq.NewTask("SyncDataTask", payload), asynq.Timeout(time.Second*3600), // The timeout period of the task is set to 1 hour ) **Expected behavior** The task takes about half an hour to complete, after several tests, in the process of processing occasionally occurs asynq: task lease expired, resulting in the task is terminated, hope the author pay attention to this problem, thank you! **Screenshots** ... **Environment (please complete the following information):** - OS: MacOS or Linux - Version of `asynq` package v0.24.1 **Additional context** ....
Author
Owner

@alipeng commented on GitHub (Dec 31, 2023):

Maybe you should check your redis first. redis-cli info | grep memory_human. I also encountered the same problem. Finally, I checked and found that it was a redis problem. It's redis maxmemory-policy "volatile-lru"

<!-- gh-comment-id:1872672217 --> @alipeng commented on GitHub (Dec 31, 2023): Maybe you should check your redis first. `redis-cli info | grep memory_human`. I also encountered the same problem. Finally, I checked and found that it was a redis problem. It's redis `maxmemory-policy` "volatile-lru"
Author
Owner

@justding commented on GitHub (Jan 24, 2024):

Maybe you should check your redis first. redis-cli info | grep memory_human. I also encountered the same problem. Finally, I checked and found that it was a redis problem. It's redis maxmemory-policy "volatile-lru"

in processor func exe() { msg, leaseExpirationTime, err := p.broker.Dequeue(qnames...)}

<!-- gh-comment-id:1907211318 --> @justding commented on GitHub (Jan 24, 2024): > Maybe you should check your redis first. `redis-cli info | grep memory_human`. I also encountered the same problem. Finally, I checked and found that it was a redis problem. It's redis `maxmemory-policy` "volatile-lru" in processor func exe() { msg, leaseExpirationTime, err := p.broker.Dequeue(qnames...)}
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#393
No description provided.