[ARVADOS] updated: 3ded4c192b1fc655d9fffa225f792055f10f78c9
git at public.curoverse.com
git at public.curoverse.com
Sat Nov 7 09:01:36 EST 2015
Summary of changes:
sdk/go/arvadosclient/arvadosclient.go | 8 ++++----
sdk/go/arvadosclient/arvadosclient_test.go | 12 ++++++++++++
tools/keep-rsync/keep-rsync_test.go | 10 +++++-----
3 files changed, 21 insertions(+), 9 deletions(-)
via 3ded4c192b1fc655d9fffa225f792055f10f78c9 (commit)
via f9577d8ec75fdf861c7dd69ed8cbbc6c3f445669 (commit)
via 4ec9919ea6cce4ada252f1e0a0dc521fe27e508c (commit)
from db68fd029f681f380f218b9b2f4fec3a315f140c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit 3ded4c192b1fc655d9fffa225f792055f10f78c9
Author: radhika <radhika at curoverse.com>
Date: Sat Nov 7 09:00:49 2015 -0500
5538: correct retryable list and use it to determine whether to close idle connections; add a few more test cases.
diff --git a/sdk/go/arvadosclient/arvadosclient.go b/sdk/go/arvadosclient/arvadosclient.go
index 2b6a36a..b67eaa5 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()
diff --git a/sdk/go/arvadosclient/arvadosclient_test.go b/sdk/go/arvadosclient/arvadosclient_test.go
index a4fe136..bc88c44 100644
--- a/sdk/go/arvadosclient/arvadosclient_test.go
+++ b/sdk/go/arvadosclient/arvadosclient_test.go
@@ -273,6 +273,12 @@ type APIStub struct {
func (s *MockArvadosServerSuite) TestWithRetries(c *C) {
for _, stub := range []APIStub{
{
+ "get", 0, 200, []int{200, 500}, []string{`{"ok":"ok"}`, ``},
+ },
+ {
+ "create", 0, 200, []int{200, 500}, []string{`{"ok":"ok"}`, ``},
+ },
+ {
"get", 0, 500, []int{500, 500, 500, 200}, []string{``, ``, ``, `{"ok":"ok"}`},
},
{
@@ -297,6 +303,12 @@ func (s *MockArvadosServerSuite) TestWithRetries(c *C) {
"create", 0, 200, []int{500, 500, 200}, []string{``, ``, `{"ok":"ok"}`},
},
{
+ "delete", 0, 200, []int{500, 500, 200}, []string{``, ``, `{"ok":"ok"}`},
+ },
+ {
+ "update", 0, 200, []int{500, 500, 200}, []string{``, ``, `{"ok":"ok"}`},
+ },
+ {
"get", 0, 401, []int{401, 200}, []string{``, `{"ok":"ok"}`},
},
{
commit f9577d8ec75fdf861c7dd69ed8cbbc6c3f445669
Merge: db68fd0 4ec9919
Author: radhika <radhika at curoverse.com>
Date: Sat Nov 7 08:42:38 2015 -0500
Merge branch 'master' into 5538-arvadosclient-retry
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list