asynq
asynq copied to clipboard
[BUG] connect error when use older redis (undex7.2.x)
Describe the bug when connect to older redis (undex7.2.x) , will report error.
To Reproduce go.mod : asynq v0.24.1 go-redis/v9 v9.5.0
Expected behavior
Screenshots
asynq: pid=34328 2024/02/20 05:44:55.832563 WARN: recoverer: could not list lease expired tasks: INTERNAL_ERROR: redis eval error: ERR Unknown subcommand or wrong number of arguments for 'setinfo'. Try CLIENT HELP
asynq: pid=34328 2024/02/20 05:44:55.870496 ERROR: Dequeue error: UNKNOWN: redis eval error: ERR Unknown subcommand or wrong number of arguments for 'setinfo'. Try CLIENT HELP
asynq: pid=34328 2024/02/20 05:44:55.919511 ERROR: Failed to write server state data: UNKNOWN: redis command error: SADD failed: ERR Unknown subcommand or wrong number of arguments for 'setinfo'. Try CLIENT HELP
asynq: pid=34328 2024/02/20 05:44:55.952470 WARN: recoverer: could not reclaim stale aggregation sets in queue "default": INTERNAL_ERROR: redis eval error: ERR Unknown subcommand or wrong number of arguments for 'setinfo'. Try CLIENT HELP
Environment (please complete the following information):
- OS: Linux
- Version of
asynq
package: asynq v0.24.1
Related issue:
redis/go-redis#2910
redis/go-redis#2911
temp resolve: opt.DisableIndentity = true
type FixedRedisClientOpt struct {
Addr string
Password string
DB int
}
func (opt FixedRedisClientOpt) MakeRedisClient() interface{} {
return redis.NewClient(&redis.Options{
Addr: opt.Addr,
Password: opt.Password,
DB: opt.DB,
DisableIndentity: true,
})
}
asynq.NewClient(FixedRedisClientOpt{Addr: "localhost:6379", Password: "password", DB: 0})
Known bug with v9.5.0. If you are using Redis elsewhere or sharing a connection pool, you can expect this problem. We will hold off on bumping go-redis in this library for now.