Compare commits

...

2 Commits

Author SHA1 Message Date
Bhargav Dodla 50058e28f2 fix: Fixed issue with context cancelled error leading to connection spikes on Master 2024-11-15 15:14:37 -08:00
Vladyslav Vildanov 6866752601 Updated package version (#3134)
* Updated package version

* Changed version format according to specification

* Updated submodule versions
2024-11-15 15:10:47 -08:00
2 changed files with 12 additions and 1 deletions

View File

@ -38,6 +38,15 @@ type Error interface {
var _ Error = proto.RedisError("")
func isContextError(err error) bool {
switch err {
case context.Canceled, context.DeadlineExceeded:
return true
default:
return false
}
}
func shouldRetry(err error, retryTimeout bool) bool {
switch err {
case io.EOF, io.ErrUnexpectedEOF:

View File

@ -1321,7 +1321,9 @@ func (c *ClusterClient) processPipelineNode(
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
cn, err := node.Client.getConn(ctx)
if err != nil {
node.MarkAsFailing()
if !isContextError(err) {
node.MarkAsFailing()
}
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
setCmdsErr(cmds, err)
return err