Handle ErrChunkingResubmit.Error properly

Previously canRetry was attempting to retrieve this error from args, however there was never
any callers that would pass an error to args.

With the change to raftApply to move this error to the error return value, it is now possible
to receive this error from the err argument.

This commit updates canRetry to check for ErrChunkingResubmit in err.
This commit is contained in:
Daniel Nephin 2021-04-09 13:34:09 -04:00
parent 8654adfc53
commit 6d1a5b3629
1 changed files with 2 additions and 3 deletions

View File

@ -535,9 +535,8 @@ func canRetry(args interface{}, err error) bool {
return true
}
// If we are chunking and it doesn't seem to have completed, try again
intErr, ok := args.(error)
if ok && strings.Contains(intErr.Error(), ErrChunkingResubmit.Error()) {
// If we are chunking and it doesn't seem to have completed, try again.
if err != nil && strings.Contains(err.Error(), ErrChunkingResubmit.Error()) {
return true
}