From 6d1a5b362928d9395569fda2e6e04484e0e2ea98 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Fri, 9 Apr 2021 13:34:09 -0400 Subject: [PATCH] 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. --- agent/consul/rpc.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/agent/consul/rpc.go b/agent/consul/rpc.go index ff7cf53d8..80d5b95e6 100644 --- a/agent/consul/rpc.go +++ b/agent/consul/rpc.go @@ -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 }