Skip to content

Commit

Permalink
Fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Sep 17, 2020
1 parent 297e671 commit c5d4b71
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 140 deletions.
12 changes: 3 additions & 9 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -751,15 +751,6 @@ func (c *ClusterClient) Process(ctx context.Context, cmd Cmder) error {
}

func (c *ClusterClient) process(ctx context.Context, cmd Cmder) error {
err := c._process(ctx, cmd)
if err != nil {
cmd.SetErr(err)
return err
}
return nil
}

func (c *ClusterClient) _process(ctx context.Context, cmd Cmder) error {
cmdInfo := c.cmdInfo(cmd.Name())
slot := c.cmdSlot(cmd)

Expand Down Expand Up @@ -1197,9 +1188,12 @@ func (c *ClusterClient) pipelineReadCmds(
) error {
for _, cmd := range cmds {
err := cmd.readReply(rd)
cmd.SetErr(err)

if err == nil {
continue
}

if c.checkMovedErr(ctx, cmd, err, failedCmds) {
continue
}
Expand Down
Loading

0 comments on commit c5d4b71

Please sign in to comment.