Skip to content

Commit

Permalink
Merge branch 'graph' of github.com:redis/go-redis into graph
Browse files Browse the repository at this point in the history
  • Loading branch information
monkey92t committed Apr 12, 2024
2 parents 96acf1a + a8f5866 commit 41ba582
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osscluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1295,6 +1295,7 @@ 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()
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
setCmdsErr(cmds, err)
return err
Expand All @@ -1316,6 +1317,9 @@ func (c *ClusterClient) processPipelineNodeConn(
if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
return writeCmds(wr, cmds)
}); err != nil {
if isBadConn(err, false, node.Client.getAddr()) {
node.MarkAsFailing()
}
if shouldRetry(err, true) {
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
}
Expand Down Expand Up @@ -1347,7 +1351,7 @@ func (c *ClusterClient) pipelineReadCmds(
continue
}

if c.opt.ReadOnly {
if c.opt.ReadOnly && isBadConn(err, false, node.Client.getAddr()) {
node.MarkAsFailing()
}

Expand Down

0 comments on commit 41ba582

Please sign in to comment.