Resource Quotas: Rate Limiting (#9330)

This commit is contained in:
Vishal Nayak
2020-06-26 17:13:16 -04:00
committed by GitHub
parent ab08ff4c47
commit c68e270863
29 changed files with 2516 additions and 84 deletions

View File

@@ -27,8 +27,8 @@ func (r *Response) DecodeJSON(out interface{}) error {
// body must still be closed manually.
func (r *Response) Error() error {
// 200 to 399 are okay status codes. 429 is the code for health status of
// standby nodes.
if (r.StatusCode >= 200 && r.StatusCode < 400) || r.StatusCode == 429 {
// standby nodes, otherwise, 429 is treated as quota limit reached.
if (r.StatusCode >= 200 && r.StatusCode < 400) || (r.StatusCode == 429 && r.Request.URL.Path == "/v1/sys/health") {
return nil
}