X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f9577d8ec75fdf861c7dd69ed8cbbc6c3f445669..b8be976adfabb17718dee8c569129cdf28036380:/sdk/go/arvadosclient/arvadosclient.go diff --git a/sdk/go/arvadosclient/arvadosclient.go b/sdk/go/arvadosclient/arvadosclient.go index 2b6a36abec..8cdfa484bd 100644 --- a/sdk/go/arvadosclient/arvadosclient.go +++ b/sdk/go/arvadosclient/arvadosclient.go @@ -165,13 +165,13 @@ func (c ArvadosClient) CallRaw(method string, resourceType string, uuid string, retryable := false switch method { - case "GET", "HEAD", "PUT", "OPTIONS", "POST", "DELETE": + case "GET", "HEAD", "PUT", "OPTIONS", "DELETE": retryable = true } - // POST and DELETE are not safe to retry automatically, so we minimize - // such failures by always using a new or recently active socket - if method == "POST" || method == "DELETE" { + // Non-retryable methods such as POST are not safe to retry automatically, + // so we minimize such failures by always using a new or recently active socket + if !retryable { if time.Since(c.lastClosedIdlesAt) > MaxIdleConnectionDuration { c.lastClosedIdlesAt = time.Now() c.Client.Transport.(*http.Transport).CloseIdleConnections() @@ -273,7 +273,7 @@ func newAPIServerError(ServerAddress string, resp *http.Response) APIServerError // Returns a non-nil error if an error occurs making the API call, the // API responds with a non-successful HTTP status, or an error occurs // parsing the response body. -func (c ArvadosClient) Call(method string, resourceType string, uuid string, action string, parameters Dict, output interface{}) error { +func (c ArvadosClient) Call(method, resourceType, uuid, action string, parameters Dict, output interface{}) error { reader, err := c.CallRaw(method, resourceType, uuid, action, parameters) if reader != nil { defer reader.Close()