[GH-ISSUE #570] [FEATURE REQUEST] Update Redis GO library to support Redis 7 #2297

Closed
opened 2026-03-15 20:00:12 +03:00 by kerem · 3 comments
Owner

Originally created by @abit2 on GitHub (Nov 4, 2022).
Original GitHub issue: https://github.com/hibiken/asynq/issues/570

Originally assigned to: @hibiken on GitHub.

Is your feature request related to a problem? Please describe.
Steps to reproduce

  1. Creating a redis cluster with redis 7. link
  2. Following the steps in wiki link
  3. Run the enqueue code below.
client := asynq.NewClient(asynq.RedisClusterClientOpt{
		Addrs: []string{"localhost:7000", "localhost:7001", "localhost:7002", "localhost:7003", "localhost:7004", "localhost:7005"},
	})
	defer client.Close()

	// ------------------------------------------------------
	// Example 1: Enqueue task to be processed immediately.
	//            Use (*Client).Enqueue method.
	// ------------------------------------------------------

	task, err := tasks.NewEmailDeliveryTask(42, "some:template:id")
	if err != nil {
		log.Fatalf("could not create task: %v", err)
	}
	queues := []string{"q_1", "q_2", "q_3", "q_4"}
	for i := 0; i < 10000; i++ {
		que := queues[i%4]
		info, err := client.Enqueue(task, asynq.Queue(que))
		if err != nil {
			log.Fatalf("could not enqueue task: %v %s", err, que)
		}

		log.Printf("enqueued task: id=%s queue=%s", info.ID, info.Queue)
	}

Describe the solution you'd like
Seems to be related to the redis/v8 library results in error link
Upgrading to redis/v9 might solve this?

error: SADD failed: got 4 elements in cluster info address, expected 2 or 3

Additional context
Following the steps above to figure out how to use asynq

Originally created by @abit2 on GitHub (Nov 4, 2022). Original GitHub issue: https://github.com/hibiken/asynq/issues/570 Originally assigned to: @hibiken on GitHub. **Is your feature request related to a problem? Please describe.** Steps to reproduce 1. Creating a redis cluster with redis 7. [link](https://redis.io/docs/management/scaling/) 2. Following the steps in wiki [link](https://github.com/hibiken/asynq/wiki/Redis-Cluster) 3. Run the enqueue code below. ``` client := asynq.NewClient(asynq.RedisClusterClientOpt{ Addrs: []string{"localhost:7000", "localhost:7001", "localhost:7002", "localhost:7003", "localhost:7004", "localhost:7005"}, }) defer client.Close() // ------------------------------------------------------ // Example 1: Enqueue task to be processed immediately. // Use (*Client).Enqueue method. // ------------------------------------------------------ task, err := tasks.NewEmailDeliveryTask(42, "some:template:id") if err != nil { log.Fatalf("could not create task: %v", err) } queues := []string{"q_1", "q_2", "q_3", "q_4"} for i := 0; i < 10000; i++ { que := queues[i%4] info, err := client.Enqueue(task, asynq.Queue(que)) if err != nil { log.Fatalf("could not enqueue task: %v %s", err, que) } log.Printf("enqueued task: id=%s queue=%s", info.ID, info.Queue) } ``` **Describe the solution you'd like** Seems to be related to the redis/v8 library results in error [link](https://github.com/go-redis/redis#installation) Upgrading to redis/v9 might solve this? ``` error: SADD failed: got 4 elements in cluster info address, expected 2 or 3 ``` **Additional context** Following the steps above to figure out how to use asynq
kerem 2026-03-15 20:00:12 +03:00
Author
Owner

@kamikazechaser commented on GitHub (Nov 14, 2022):

go-redis/v9 is not backward compatible afaik. This would be a breaking change.

<!-- gh-comment-id:1313250654 --> @kamikazechaser commented on GitHub (Nov 14, 2022): go-redis/v9 is not backward compatible afaik. This would be a breaking change.
Author
Owner

@kamikazechaser commented on GitHub (Jan 31, 2023):

https://github.com/redis/go-redis/discussions/2241

^ Relevant discussion.

Might need some testing with redis v6 and v7 with go-redis v9. If it passes, we could use go-redis v9.

<!-- gh-comment-id:1409845275 --> @kamikazechaser commented on GitHub (Jan 31, 2023): https://github.com/redis/go-redis/discussions/2241 ^ Relevant discussion. Might need some testing with redis v6 and v7 with go-redis v9. If it passes, we could use go-redis v9.
Author
Owner

@kamikazechaser commented on GitHub (Mar 6, 2023):

Related to #602

<!-- gh-comment-id:1455716239 --> @kamikazechaser commented on GitHub (Mar 6, 2023): Related to #602
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#2297
No description provided.