From 564fc0cc80e89c31187a94480860637c9b08bd46 Mon Sep 17 00:00:00 2001 From: Wojciech Tyczynski Date: Mon, 17 Oct 2016 11:45:35 +0200 Subject: [PATCH] Throttle retried requests in client --- pkg/client/restclient/request.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/client/restclient/request.go b/pkg/client/restclient/request.go index 2473a12bf21..afddea093bf 100644 --- a/pkg/client/restclient/request.go +++ b/pkg/client/restclient/request.go @@ -795,6 +795,12 @@ func (r *Request) request(fn func(*http.Request, *http.Response)) error { req.Header = r.headers r.backoffMgr.Sleep(r.backoffMgr.CalculateBackoff(r.URL())) + if retries > 0 { + // We are retrying the request that we already send to apiserver + // at least once before. + // This request should also be throttled with the client-internal throttler. + r.tryThrottle() + } resp, err := client.Do(req) updateURLMetrics(r, resp, err) if err != nil {