Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to close redis client connection: redis connection is shared so the Client can't be closed through asynq #1022

Open
MadanaGopalD opened this issue Feb 13, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@MadanaGopalD
Copy link

Describe the bug
A clear and concise description of what the bug is.

Environment (please complete the following information):

  • OS: Linux
  • asynq package version [e.g. v0.25.1]
  • Redis/Valkey version

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

func NewRedisClient(dataCfg *conf.Data, logger log.Logger) (redis.UniversalClient, func()) {
// log := log.NewHelper(logger)
var addrs = []string{dataCfg.Redis.Addr}
rdb := redis.NewUniversalClient(&redis.UniversalOptions{Addrs: addrs,
Password: dataCfg.Redis.Password,
WriteTimeout: dataCfg.Redis.WriteTimeout.AsDuration(),
ReadTimeout: dataCfg.Redis.ReadTimeout.AsDuration()})
return rdb, func() {
log.Info("closing redis connection")
if err := rdb.Close(); err != nil {
log.Error("error in closing redis client ", err)
}
}
}

func NewAsynqClientConn(redis redis.UniversalClient) *asynq.Client {
asynqClient := asynq.NewClientFromRedisClient(redis)
return asynqClient
}

I have created AsynqClient, AsynqServer and PeriodicTaskManager in my application, but while closing the application I am getting the following error
asynq: pid=53613 2025/02/13 10:14:23.071065 ERROR: Failed to close redis client connection: redis connection is shared so the Client can't be closed through asynq
Can someone explain me what's causing this error.

@MadanaGopalD MadanaGopalD added the bug Something isn't working label Feb 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants