From 3431a996fae81fbf33b3b979a2ac5046c5809466 Mon Sep 17 00:00:00 2001 From: Michal Fojtik Date: Tue, 18 Feb 2020 14:44:04 +0100 Subject: [PATCH] rest: remove connection refused from the list of retriable errors Kubernetes-commit: 0dfe0c793b5b85bd85cec7b77679ba78c1617357 --- rest/request.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest/request.go b/rest/request.go index 6b3db4aa..956d924d 100644 --- a/rest/request.go +++ b/rest/request.go @@ -827,7 +827,7 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode) } if err != nil { - // "Connection reset by peer", "Connection refused" or "apiserver is shutting down" are usually a transient errors. + // "Connection reset by peer" or "apiserver is shutting down" are usually a transient errors. // Thus in case of "GET" operations, we simply retry it. // We are not automatically retrying "write" operations, as // they are not idempotent. @@ -835,7 +835,7 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp return err } // For connection errors and apiserver shutdown errors retry. - if net.IsConnectionReset(err) || net.IsConnectionRefused(err) { + if net.IsConnectionReset(err) { // For the purpose of retry, we set the artificial "retry-after" response. // TODO: Should we clean the original response if it exists? resp = &http.Response{