Skip to content

Commit

Permalink
Fix for issues #2959 and #2960 (#2961)
Browse files Browse the repository at this point in the history
Co-authored-by: Hu Ying <ying.hu@shopee.com>
  • Loading branch information
singular-seal and Hu Ying committed Apr 12, 2024
1 parent 6833d2f commit f5496d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion osscluster.go
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 f5496d1

Please sign in to comment.