Skip to content

Commit

Permalink
Set nodes in error if avasilable
Browse files Browse the repository at this point in the history
  • Loading branch information
khaf committed Sep 16, 2022
1 parent e9936b1 commit 1c93223
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,7 @@ func (cmd *baseCommand) executeAt(ifc command, policy *BasePolicy, isRead bool,

// too many retries
if (policy.MaxRetries <= 0 && cmd.commandSentCounter > 0) || (policy.MaxRetries > 0 && cmd.commandSentCounter > policy.MaxRetries) {
return chainErrors(ErrMaxRetriesExceeded.err(), errChain).iter(cmd.commandSentCounter).setInDoubt(isRead, commandSentCounter)
return chainErrors(ErrMaxRetriesExceeded.err(), errChain).iter(cmd.commandSentCounter).setInDoubt(isRead, commandSentCounter).setNode(cmd.node)
}

// Sleep before trying again, after the first iteration
Expand All @@ -2476,14 +2476,14 @@ func (cmd *baseCommand) executeAt(ifc command, policy *BasePolicy, isRead bool,
if alreadyRetried {
// Batch was retried in separate subcommands. Complete this command.
if err != nil {
return chainErrors(err, errChain).iter(cmd.commandSentCounter)
return chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node)
}
return nil
}

// chain the errors and retry
if err != nil {
errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter)
errChain = chainErrors(err, errChain).iter(cmd.commandSentCounter).setNode(cmd.node)
continue
}
}
Expand Down

0 comments on commit 1c93223

Please sign in to comment.