[GH-ISSUE #529] [BUG] Client side aggregation tasks stay in "aggregating" state forever #1263

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

Originally created by @atkinsonbg on GitHub (Aug 27, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/529

Originally assigned to: @hibiken on GitHub.

Describe the bug
I using client side aggregation and the tasks are making it to the queue, however they stay in "aggregating" state forever. In this case "forever" has been 24+ hours.

Screen Shot 2022-08-27 at 9 33 18 AM

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

  1. Create two tasks using the client side pattern

`client := asynq.NewClient(asynq.RedisClientOpt{Addr: redisAddr})
defer client.Close()

task, err := tasks.NewTask1("some", "id")
if err != nil {
	log.Fatalf("could not create task: %v", err)
}

task2, err := tasks.NewTask2("some", "id")
if err != nil {
	log.Fatalf("could not create task: %v", err)
}

info, err := client.Enqueue(task, asynq.Group("move"))
if err != nil {
	log.Fatalf("could not enqueue task: %v", err)
}

info2, err := client.Enqueue(task2, asynq.Group("move"))
if err != nil {
	log.Fatalf("could not enqueue task: %v", err)
}
log.Printf("enqueued task: id=%s queue=%s", info2.ID, info.Queue)`

Expected behavior

  1. Tasks get placed in queue
  2. Aggregation grace period expires and the tasks are worked

Screenshots
See above

Environment (please complete the following information):

  • OS: MacOD
  • Version of asynq package v0.23.0

Additional context
Running this in a Docker container with a Redis docker container. If I go into AsynqMon and hit the run button on the tasks they execute successfully. Am I not Enqueueing correctly, or do I need to manually set a grace period?

Originally created by @atkinsonbg on GitHub (Aug 27, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/529 Originally assigned to: @hibiken on GitHub. **Describe the bug** I using client side aggregation and the tasks are making it to the queue, however they stay in "aggregating" state forever. In this case "forever" has been 24+ hours. ![Screen Shot 2022-08-27 at 9 33 18 AM](https://user-images.githubusercontent.com/29587193/187032492-eecf92fd-39fd-4f3d-9661-e6ae80187c89.png) **To Reproduce** Steps to reproduce the behavior (Code snippets if applicable): 1. Create two tasks using the client side pattern `client := asynq.NewClient(asynq.RedisClientOpt{Addr: redisAddr}) defer client.Close() task, err := tasks.NewTask1("some", "id") if err != nil { log.Fatalf("could not create task: %v", err) } task2, err := tasks.NewTask2("some", "id") if err != nil { log.Fatalf("could not create task: %v", err) } info, err := client.Enqueue(task, asynq.Group("move")) if err != nil { log.Fatalf("could not enqueue task: %v", err) } info2, err := client.Enqueue(task2, asynq.Group("move")) if err != nil { log.Fatalf("could not enqueue task: %v", err) } log.Printf("enqueued task: id=%s queue=%s", info2.ID, info.Queue)` **Expected behavior** 1. Tasks get placed in queue 2. Aggregation grace period expires and the tasks are worked **Screenshots** See above **Environment (please complete the following information):** - OS: MacOD - Version of `asynq` package v0.23.0 **Additional context** Running this in a Docker container with a Redis docker container. If I go into AsynqMon and hit the run button on the tasks they execute successfully. Am I not Enqueueing correctly, or do I need to manually set a grace period?
kerem 2026-03-07 22:08:05 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@atkinsonbg commented on GitHub (Aug 27, 2022):

Now that I've stepped away for a day I think I'm reading the docs wrong: https://github.com/hibiken/asynq/wiki/Task-aggregation

I need to queue them on the client, but I also need to tell the server how to aggregate those tasks? OK, that makes sense. However, is there a pattern on how I can provide multiple aggregates to the server?

<!-- gh-comment-id:1229195529 --> @atkinsonbg commented on GitHub (Aug 27, 2022): Now that I've stepped away for a day I think I'm reading the docs wrong: https://github.com/hibiken/asynq/wiki/Task-aggregation I need to queue them on the client, but I also need to tell the server how to aggregate those tasks? OK, that makes sense. However, is there a pattern on how I can provide multiple aggregates to the server?
Author
Owner

@atkinsonbg commented on GitHub (Aug 27, 2022):

Ok, sorry, closing this issue as it’s not an issue. Just needed a day to walk away and come back with fresh eyes. I implemented the aggregator per your example and it works as expected.

Thanks for working on this, I’m really enjoying the functionality!

<!-- gh-comment-id:1229223739 --> @atkinsonbg commented on GitHub (Aug 27, 2022): Ok, sorry, closing this issue as it’s not an issue. Just needed a day to walk away and come back with fresh eyes. I implemented the aggregator per your example and it works as expected. Thanks for working on this, I’m really enjoying the functionality!
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#1263
No description provided.