mirror of
https://github.com/hibiken/asynq.git
synced 2026-04-26 07:25:56 +03:00
[GH-ISSUE #309] [BUG] asynq client failed when use command stats #1144
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#1144
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 @duyhungtnn on GitHub (Aug 7, 2021).
Original GitHub issue: https://github.com/hibiken/asynq/issues/309
Originally assigned to: @hibiken on GitHub.
Describe the bug
asynq stats. It take so long to complete and end up withTo Reproduce
Steps to reproduce the behavior (Code snippets if applicable):
0. Setup redis with docker-compose
Expected behavior
Screenshots

If applicable, add screenshots to help explain your problem.
Environment (please complete the following information):
asynqpackage [v0.18.2]Additional context
The worker and scheduler work as normal

The data on Redis is okay too

@crossworth commented on GitHub (Aug 7, 2021):
Hello, I have encoutered this problem as well, but using
asynqmon, I could not yet determine why (for this reason I havent create a issue or pr), but I know that I can cause it by enqueuing a lot of tasks and processing they very fast (no code, no printing, just a empty handler).Probably the MEMORY USAGE command is returning nil and since we dont handle it we get this error message.
I will investigate it.
@hibiken commented on GitHub (Aug 7, 2021):
@duyhungtnn thank you for reporting this!
Could you double check the CLI version by running
asynq version?@hibiken commented on GitHub (Aug 7, 2021):
The error message in the screenshot is coming from here:
github.com/hibiken/asynq@95c90a5cb8/internal/rdb/inspect.go (L197)My initial guess is that the for loop for the scan command is taking too long (
github.com/hibiken/asynq@95c90a5cb8/internal/rdb/inspect.go (L183)) since we recently changed each task to have its only redis key.Since redis only executes one command at a time, since other clients are sending commands to redis while this for loop is executing scan commands to collect all keys, keys may have been deleted (i.e. task processed successfully), you'll see the key not found error when
memeorUsagecommand is invoked.If this above analysis is correct, then we should make this operation into a Lua script and run the script with EXECUTE so that all of this operation becomes atomic (i.e. other clients commands won't be executing between multiple calls to scan and memoryusage). But now that we can have a lot more redis-keys than before (each task has its own key), maybe getting memory usage within a short timeframe is not feasible anymore.
@duyhungtnn commented on GitHub (Aug 7, 2021):
@hibiken yeah my asynq is
asynq version 0.18.2@crossworth I am facing that issue with
asynqmontoo. The web dashboard display nothing when viewing the queue info.Yes, I was using a scheduler to trigger a single task every 2h. On that single task will enqueue 5000 tasks to feed the workers. It may be the cause.
@hibiken commented on GitHub (Aug 9, 2021):
@duyhungtnn The fix is in 👍
Let me know if you continue to see issues with new versions (asynq: v0.18.3, asynqmon v0.2.2)