|
|
|
@ -367,13 +367,12 @@ func (adm AdminClient) executeMethod(ctx context.Context, method string, reqData |
|
|
|
|
// Initiate the request.
|
|
|
|
|
res, err = adm.do(req) |
|
|
|
|
if err != nil { |
|
|
|
|
// For supported http requests errors verify.
|
|
|
|
|
if isHTTPReqErrorRetryable(err) { |
|
|
|
|
continue // Retry.
|
|
|
|
|
} |
|
|
|
|
// For other errors, return here no need to retry.
|
|
|
|
|
if err == context.Canceled || err == context.DeadlineExceeded { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
// retry all network errors.
|
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// For any known successful http status, return quickly.
|
|
|
|
|
for _, httpStatus := range successStatus { |
|
|
|
@ -413,6 +412,12 @@ func (adm AdminClient) executeMethod(ctx context.Context, method string, reqData |
|
|
|
|
|
|
|
|
|
break |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Return an error when retry is canceled or deadlined
|
|
|
|
|
if e := retryCtx.Err(); e != nil { |
|
|
|
|
return nil, e |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return res, err |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|