Skip to content

connection pool timeout - not reconnect #3289

Open
@parsibox

Description

@parsibox

hi
i use go 1.23 on linux 64 bit
today my redis has a problem and i restarted that but my golang code have error and not reconnected

this is my code

	RedisClient = redis.NewClient(&redis.Options{
		Addr:     ip + ":" + port, //"localhost:6379",
		Password: password,
		DB:       db,
		PoolSize: poolSize,
		ConnMaxLifetime: time.Minute * 10,
		DialTimeout:     time.Second * 10,
		ReadTimeout:     time.Second * 30,
		WriteTimeout:    time.Second * 10,
		MaxRetries:      3000,
		MinRetryBackoff: time.Second * 2,
		MaxRetryBackoff: time.Second * 10,
		OnConnect: func(ctx context.Context, cn *redis.Conn) error {
			logger.Info("ConRedis connected")
			return nil
		},
	})
	if err := RedisClient.Ping(context.Background()).Err(); err != nil {
		// Handle connection error
		logger.Error("ConRedis error")
	}

i get error : redis: connection pool timeout

why pool connection not renew?or not reconnect again?after i restarted my code it work !!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions