Skip to content

Commit f5496d1

Browse files
singular-sealHu Ying
and
Hu Ying
authored
Fix for issues #2959 and #2960 (#2961)
Co-authored-by: Hu Ying <[email protected]>
1 parent 6833d2f commit f5496d1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

osscluster.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1295,6 +1295,7 @@ func (c *ClusterClient) processPipelineNode(
12951295
_ = node.Client.withProcessPipelineHook(ctx, cmds, func(ctx context.Context, cmds []Cmder) error {
12961296
cn, err := node.Client.getConn(ctx)
12971297
if err != nil {
1298+
node.MarkAsFailing()
12981299
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
12991300
setCmdsErr(cmds, err)
13001301
return err
@@ -1316,6 +1317,9 @@ func (c *ClusterClient) processPipelineNodeConn(
13161317
if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
13171318
return writeCmds(wr, cmds)
13181319
}); err != nil {
1320+
if isBadConn(err, false, node.Client.getAddr()) {
1321+
node.MarkAsFailing()
1322+
}
13191323
if shouldRetry(err, true) {
13201324
_ = c.mapCmdsByNode(ctx, failedCmds, cmds)
13211325
}
@@ -1347,7 +1351,7 @@ func (c *ClusterClient) pipelineReadCmds(
13471351
continue
13481352
}
13491353

1350-
if c.opt.ReadOnly {
1354+
if c.opt.ReadOnly && isBadConn(err, false, node.Client.getAddr()) {
13511355
node.MarkAsFailing()
13521356
}
13531357

0 commit comments

Comments
 (0)