mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-27 07:28:14 +00:00
Merge pull request #88267 from mfojtik/revert-con-refused-retry
client-go: remove connection refused to list of retriable errors Kubernetes-commit: f38ca13bc8c6e1d99be33afa2b9d3a3f6fb56ba3
This commit is contained in:
commit
6f32816696
@ -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)
|
r.backoff.UpdateBackoff(r.URL(), err, resp.StatusCode)
|
||||||
}
|
}
|
||||||
if err != nil {
|
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.
|
// Thus in case of "GET" operations, we simply retry it.
|
||||||
// We are not automatically retrying "write" operations, as
|
// We are not automatically retrying "write" operations, as
|
||||||
// they are not idempotent.
|
// they are not idempotent.
|
||||||
@ -835,7 +835,7 @@ func (r *Request) request(ctx context.Context, fn func(*http.Request, *http.Resp
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// For connection errors and apiserver shutdown errors retry.
|
// 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.
|
// For the purpose of retry, we set the artificial "retry-after" response.
|
||||||
// TODO: Should we clean the original response if it exists?
|
// TODO: Should we clean the original response if it exists?
|
||||||
resp = &http.Response{
|
resp = &http.Response{
|
||||||
|
Loading…
Reference in New Issue
Block a user