[ARVADOS] updated: 7d887106d3eabb9844c4a687403a18581167a823

git at public.curoverse.com git at public.curoverse.com
Fri Oct 23 11:15:06 EDT 2015


Summary of changes:
 doc/_includes/_run_command_simple_example.liquid   | 15 +++--
 doc/_includes/_ssh_addkey.liquid                   |  2 +-
 .../_tutorial_bwa_sortsam_pipeline.liquid          |  2 +-
 doc/index.html.liquid                              |  2 +-
 doc/install/install-sso.html.textile.liquid        |  3 +-
 .../ssh-access-unix.html.textile.liquid            |  2 +-
 .../ssh-access-windows.html.textile.liquid         |  6 +-
 .../vm-login-with-webshell.html.textile.liquid     |  2 +-
 doc/user/index.html.textile.liquid                 |  4 +-
 ...tutorial-pipeline-workbench.html.textile.liquid |  6 +-
 sdk/go/keepclient/keepclient.go                    |  8 ++-
 sdk/go/keepclient/keepclient_test.go               | 54 ++++++++++++++++-
 sdk/go/keepclient/support.go                       | 67 ++++++++++++++--------
 sdk/python/arvados/api.py                          | 11 ++++
 sdk/python/arvados/commands/run.py                 |  4 +-
 sdk/python/arvados/keep.py                         |  2 +-
 sdk/python/tests/nginx.conf                        |  2 +-
 sdk/python/tests/run_test_server.py                | 21 +++++--
 sdk/python/tests/test_keep_client.py               | 36 +++++++-----
 services/keepproxy/keepproxy.go                    |  2 +-
 services/keepproxy/keepproxy_test.go               | 41 +++++++++++--
 tools/keep-rsync/keep-rsync.go                     |  4 +-
 22 files changed, 217 insertions(+), 79 deletions(-)

       via  7d887106d3eabb9844c4a687403a18581167a823 (commit)
       via  f5ab6191a96ce31defe0269b9bc739c6492c1a90 (commit)
       via  92768ce858673678aa7924f83ad41e2a9f8dd678 (commit)
       via  31eb1bdc31e1d030844a6fdc7f4ba4286ec79d4f (commit)
       via  a81ba64fcf67efcdb1323402612ca3fe5abf7b92 (commit)
       via  34941aef29a05cb6b3653e1d53a3c80591fabb7b (commit)
       via  8cbdec0e12dbdde43405a61e3259c16840233212 (commit)
       via  036656d9d65ee62771d0b47b5b3407aece833c8b (commit)
       via  1dd5b73a66b107d16ae4ccc0e97e5b4a18caef17 (commit)
       via  4df91a01ad793744d7370b1ad5837543ed76c242 (commit)
       via  98d7f56eb8b518444c732b53f18b0390a40dc224 (commit)
       via  f0ea4324260fb4dc6df693d9548285bb64b3b69f (commit)
       via  689f463bbd231fba8e32b6d46a963d0dacf0e509 (commit)
       via  78068d0f47e28b8caae3a16fb5a5a5c4037a287b (commit)
       via  5130d0237e8a0be9d0593f222181317e3c9ec57a (commit)
       via  b23dbeaa9a3900e6a5fe6ed2df53d191317f31ec (commit)
       via  38625a4ac1665055951265c1373a0e38a36a125d (commit)
       via  5da8705c0633e8a79b00ceab5904eb4c632963d3 (commit)
       via  5f93585b16f2b5ac9c2e86f8dea876b310cbcf57 (commit)
       via  3d4717f6f48957d58d46fa0ecb4e65e3f49b1858 (commit)
       via  3da10f0c0f5a0c0c91d49436a5995c890b03d228 (commit)
       via  6b1b4d80445f0e03f89c46a167bebefe7bcf97c0 (commit)
       via  329da35b297dc38f3f32198ed1c7e09bbace7c0e (commit)
       via  66dd4459251971acceae41622e2e1221892a8872 (commit)
       via  17568511436d6721de01870fead8995796243ee8 (commit)
       via  08a15a1e6b8e6f2e44f18328c1f6dd25343cffc2 (commit)
       via  c31abb2aa1a1e4493ee1f3ed2d63163cf7b4cafb (commit)
       via  716d6859bda672865c1266818bbc9814cfa9e64e (commit)
       via  d26a444780cafcc06d20d42cef114f608e0e114d (commit)
       via  43e2110902218494d1f0d69936bdb98456557248 (commit)
       via  88be56a262ab073e6aa96bdf6f80464731562a33 (commit)
       via  89b0d40ef05354a2b298a96ec3fc7a879f7f5328 (commit)
      from  da453701654115387e6b11189c6a830f24abf715 (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 7d887106d3eabb9844c4a687403a18581167a823
Author: radhika <radhika at curoverse.com>
Date:   Fri Oct 23 11:14:43 2015 -0400

    7492: cleanup error checking in keepproxy

diff --git a/sdk/go/keepclient/keepclient.go b/sdk/go/keepclient/keepclient.go
index a018eb4..2f809b3 100644
--- a/sdk/go/keepclient/keepclient.go
+++ b/sdk/go/keepclient/keepclient.go
@@ -169,10 +169,14 @@ func (kc *KeepClient) PutR(r io.Reader) (locator string, replicas int, err error
 
 func (kc *KeepClient) getOrHead(method string, locator string) (io.ReadCloser, int64, string, error) {
 	var errs []string
-	var count404 int
 
 	tries_remaining := 1 + kc.Retries
+
 	serversToTry := kc.getSortedRoots(locator)
+
+	numServers := len(serversToTry)
+	count404 := 0
+
 	var retryList []string
 
 	for tries_remaining > 0 {
@@ -231,7 +235,7 @@ func (kc *KeepClient) getOrHead(method string, locator string) (io.ReadCloser, i
 	log.Printf("DEBUG: %s %s failed: %v", method, locator, errs)
 
 	var err error
-	if count404 == len(kc.getSortedRoots(locator)) {
+	if count404 == numServers {
 		err = BlockNotFound
 	} else {
 		err = &ErrNotFound{multipleResponseError{
diff --git a/sdk/go/keepclient/keepclient_test.go b/sdk/go/keepclient/keepclient_test.go
index ddfb20e..4acaf70 100644
--- a/sdk/go/keepclient/keepclient_test.go
+++ b/sdk/go/keepclient/keepclient_test.go
@@ -559,7 +559,6 @@ func (s *StandaloneSuite) TestGetFail(c *C) {
 	r, n, url2, err := kc.Get(hash)
 	errNotFound, _ := err.(ErrNotFound)
 	c.Check(errNotFound, NotNil)
-	c.Check(strings.Contains(err.Error(), "use of closed network connection"), Equals, true)
 	c.Check(n, Equals, int64(0))
 	c.Check(url2, Equals, "")
 	c.Check(r, Equals, nil)
diff --git a/services/keepproxy/keepproxy.go b/services/keepproxy/keepproxy.go
index 3cf1e28..d3dbeaf 100644
--- a/services/keepproxy/keepproxy.go
+++ b/services/keepproxy/keepproxy.go
@@ -376,7 +376,7 @@ func (this GetBlockHandler) ServeHTTP(resp http.ResponseWriter, req *http.Reques
 			}
 		}
 	case keepclient.Error:
-		if respErr.Error() == "Block not found" {
+		if respErr == keepclient.BlockNotFound {
 			status = http.StatusNotFound
 		} else if respErr.Temporary() {
 			status = http.StatusBadGateway
diff --git a/services/keepproxy/keepproxy_test.go b/services/keepproxy/keepproxy_test.go
index 17caefb..e0d4a79 100644
--- a/services/keepproxy/keepproxy_test.go
+++ b/services/keepproxy/keepproxy_test.go
@@ -172,18 +172,14 @@ func (s *ServerRequiredSuite) TestPutAskGet(c *C) {
 
 	{
 		_, _, err := kc.Ask(hash)
-		errNotFound, _ := err.(keepclient.ErrNotFound)
-		c.Check(errNotFound, NotNil)
-		c.Check(strings.Contains(err.Error(), "Block not found"), Equals, true)
+		c.Check(err, Equals, keepclient.BlockNotFound)
 		log.Print("Finished Ask (expected BlockNotFound)")
 	}
 
 	{
 		reader, _, _, err := kc.Get(hash)
 		c.Check(reader, Equals, nil)
-		errNotFound, _ := err.(keepclient.ErrNotFound)
-		c.Check(errNotFound, NotNil)
-		c.Check(strings.Contains(err.Error(), "Block not found"), Equals, true)
+		c.Check(err, Equals, keepclient.BlockNotFound)
 		log.Print("Finished Get (expected BlockNotFound)")
 	}
 
@@ -489,3 +485,36 @@ func (s *ServerRequiredSuite) TestGetIndex(c *C) {
 	_, err = kc.GetIndex("proxy", "xyz")
 	c.Assert((err != nil), Equals, true)
 }
+
+func (s *ServerRequiredSuite) TestPutAskGetInvalidToken(c *C) {
+	kc := runProxy(c, []string{"keepproxy"}, 28852, false)
+	waitForListener()
+	defer closeListener()
+
+	// Put a test block
+	hash, rep, err := kc.PutB([]byte("foo"))
+	c.Check(err, Equals, nil)
+	c.Check(rep, Equals, 2)
+
+	for _, token := range []string{
+		"nosuchtoken",
+		"2ym314ysp27sk7h943q6vtc378srb06se3pq6ghurylyf3pdmx", // expired
+	} {
+		// Change token to given bad token
+		kc.Arvados.ApiToken = token
+
+		// Ask should result in error
+		_, _, err = kc.Ask(hash)
+		c.Check(err, NotNil)
+		errNotFound, _ := err.(keepclient.ErrNotFound)
+		c.Check(errNotFound.Temporary(), Equals, false)
+		c.Assert(strings.Contains(err.Error(), "HTTP 403"), Equals, true)
+
+		// Get should result in error
+		_, _, _, err = kc.Get(hash)
+		c.Check(err, NotNil)
+		errNotFound, _ = err.(keepclient.ErrNotFound)
+		c.Check(errNotFound.Temporary(), Equals, false)
+		c.Assert(strings.Contains(err.Error(), "HTTP 403 \"Missing or invalid Authorization header\""), Equals, true)
+	}
+}

commit f5ab6191a96ce31defe0269b9bc739c6492c1a90
Merge: 5130d02 92768ce
Author: radhika <radhika at curoverse.com>
Date:   Fri Oct 23 09:44:47 2015 -0400

    Merge branch 'master' into 7492-keepproxy-upstream-errors

diff --cc sdk/go/keepclient/keepclient_test.go
index 3714a54,c03ba90..ddfb20e
--- a/sdk/go/keepclient/keepclient_test.go
+++ b/sdk/go/keepclient/keepclient_test.go
@@@ -553,11 -553,10 +554,12 @@@ func (s *StandaloneSuite) TestGetFail(
  	kc, _ := MakeKeepClient(&arv)
  	arv.ApiToken = "abc123"
  	kc.SetServiceRoots(map[string]string{"x": ks.url}, nil, nil)
+ 	kc.Retries = 0
  
  	r, n, url2, err := kc.Get(hash)
 -	c.Check(err, Equals, BlockNotFound)
 +	errNotFound, _ := err.(ErrNotFound)
 +	c.Check(errNotFound, NotNil)
 +	c.Check(strings.Contains(err.Error(), "use of closed network connection"), Equals, true)
  	c.Check(n, Equals, int64(0))
  	c.Check(url2, Equals, "")
  	c.Check(r, Equals, nil)

commit 5130d0237e8a0be9d0593f222181317e3c9ec57a
Merge: da45370 b23dbea
Author: radhika <radhika at curoverse.com>
Date:   Wed Oct 21 09:00:58 2015 -0400

    Merge branch 'master' into 7492-keepproxy-upstream-errors


-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list