Add response header timeouts (#9170)

- Add conservative timeouts upto 3 minutes
  for internode communication
- Add aggressive timeouts of 30 seconds
  for gateway communication

Fixes #9105
Fixes #8732
Fixes #8881
Fixes #8376
Fixes #9028
This commit is contained in:
Harshavardhana
2020-03-21 22:10:13 -07:00
committed by GitHub
parent 27b8f18cce
commit 3d3beb6a9d
14 changed files with 68 additions and 56 deletions

View File

@@ -2050,7 +2050,7 @@ func (web *webAPIHandlers) LoginSTS(r *http.Request, args *LoginSTSArgs, reply *
}
clnt := &http.Client{
Transport: NewCustomHTTPTransport(),
Transport: NewGatewayHTTPTransport(),
}
resp, err := clnt.Do(req)
@@ -2059,6 +2059,7 @@ func (web *webAPIHandlers) LoginSTS(r *http.Request, args *LoginSTSArgs, reply *
return toJSONError(ctx, err)
}
defer xhttp.DrainBody(resp.Body)
if resp.StatusCode != http.StatusOK {
return toJSONError(ctx, errors.New(resp.Status))
}