Merge pull request #34939 from wojtek-t/throttle_retried_requests

Automatic merge from submit-queue

Throttle retried requests in client

Fix #34938
This commit is contained in:
Kubernetes Submit Queue
2016-10-18 10:08:53 -07:00
committed by GitHub

View File

@@ -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 {