Skip to content

Commit

Permalink
Merge pull request kubernetes#34939 from wojtek-t/throttle_retried_re…
Browse files Browse the repository at this point in the history
…quests

Automatic merge from submit-queue

Throttle retried requests in client

Fix kubernetes#34938
  • Loading branch information
Kubernetes Submit Queue authored Oct 18, 2016
2 parents 6ea0d05 + 564fc0c commit b77e134
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/client/restclient/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit b77e134

Please sign in to comment.