|
|
|
@ -367,12 +367,11 @@ 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.
|
|
|
|
|
if err == context.Canceled || err == context.DeadlineExceeded { |
|
|
|
|
return nil, err |
|
|
|
|
} |
|
|
|
|
// For other errors, return here no need to retry.
|
|
|
|
|
return nil, err |
|
|
|
|
// retry all network errors.
|
|
|
|
|
continue |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// For any known successful http status, return quickly.
|
|
|
|
@ -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 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|