gf icon indicating copy to clipboard operation
gf copied to clipboard

database/gredis: use BRPOP timeout

Open Lyotoc opened this issue 1 year ago • 0 comments

Go version

go1.22.3 linux/amd64

GoFrame version

v2.7.1

Can this bug be reproduced with the latest release?

Option Yes

What did you do?

gredis using redis's BRPOP command reports an error timeout

if msgVars, err := g.Redis.BRPop(ctx, 0, queueName); err != nil {
				logger.Errorf(ctx, "Pull message error %v", err)
				continue
			}

It seems that there is no blocking operation at the bottom layer and the TCP read timeout configured by gredis is applied in this command.

What did you see happen?

Redis Client Do failed with arguments "[BRPop queueName 31536000]": read tcp xx.xx.251.55:11898->10.40.xx.xx:6379: i/o timeout

What did you expect to see?

Normally it should be blocked and the connection should not time out.

Lyotoc avatar Jun 28 '24 08:06 Lyotoc