Skip to content

Commit

Permalink
redis.Client#XReadUntilResult(): also re-try timeout errors
Browse files Browse the repository at this point in the history
An XREAD with BLOCK sets a socket timeout of BLOCK+10s.
If reading the response hits that timeout, it's not re-tried due to BLOCK.
Hence, we have to re-ty it by ourselves.
  • Loading branch information
Al2Klimov committed Aug 8, 2024
1 parent 420fbff commit 96c22d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion redis/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ func (c *Client) XReadUntilResult(ctx context.Context, a *redis.XReadArgs) ([]re
cmd := c.XRead(ctx, a)
streams, err := cmd.Result()
if err != nil {
if errors.Is(err, redis.Nil) {
if (errors.Is(err, redis.Nil) || retry.Retryable(err)) && ctx.Err() == nil {
continue
}

Expand Down

0 comments on commit 96c22d1

Please sign in to comment.