[ARVADOS] created: 1.3.0-1515-gba2e6d49c

Git user git at public.curoverse.com
Tue Aug 13 17:15:30 UTC 2019


        at  ba2e6d49ca390a8a62aa77e531e5a255c93ebfcd (commit)


commit ba2e6d49ca390a8a62aa77e531e5a255c93ebfcd
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Aug 13 14:14:39 2019 -0300

    10998: Sets up keepclient's block cache at handler's initialization.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/keep-web/handler.go b/services/keep-web/handler.go
index 863b91a7e..f9e0c1a50 100644
--- a/services/keep-web/handler.go
+++ b/services/keep-web/handler.go
@@ -79,6 +79,7 @@ func (h *handler) setup() {
 	h.clientPool = arvadosclient.MakeClientPool()
 
 	keepclient.RefreshServiceDiscoveryOnSIGHUP()
+	keepclient.DefaultBlockCache.MaxBlocks = h.Config.cluster.Collections.WebDAVCache.MaxBlockEntries
 
 	h.healthHandler = &health.Handler{
 		Token:  h.Config.cluster.ManagementToken,

commit a5cf4e0ea356a7ee06f67fe159484fe20cd8a184
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Aug 13 14:14:04 2019 -0300

    10998: Adds test to confirm that keepclient's block cache is set up.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/services/keep-web/handler_test.go b/services/keep-web/handler_test.go
index 1d264fc05..1090151e1 100644
--- a/services/keep-web/handler_test.go
+++ b/services/keep-web/handler_test.go
@@ -21,6 +21,7 @@ import (
 	"git.curoverse.com/arvados.git/sdk/go/arvados"
 	"git.curoverse.com/arvados.git/sdk/go/arvadostest"
 	"git.curoverse.com/arvados.git/sdk/go/auth"
+	"git.curoverse.com/arvados.git/sdk/go/keepclient"
 	check "gopkg.in/check.v1"
 )
 
@@ -38,6 +39,24 @@ func (s *UnitSuite) SetUpTest(c *check.C) {
 	s.Config = cfg
 }
 
+func (s *UnitSuite) TestKeepClientBlockCache(c *check.C) {
+	cfg := newConfig(s.Config)
+	cfg.cluster.Collections.WebDAVCache.MaxBlockEntries = 42
+	h := handler{Config: cfg}
+	c.Check(keepclient.DefaultBlockCache.MaxBlocks, check.Not(check.Equals), cfg.cluster.Collections.WebDAVCache.MaxBlockEntries)
+	u := mustParseURL("http://keep-web.example/c=" + arvadostest.FooCollection + "/t=" + arvadostest.ActiveToken + "/foo")
+	req := &http.Request{
+		Method:     "GET",
+		Host:       u.Host,
+		URL:        u,
+		RequestURI: u.RequestURI(),
+	}
+	resp := httptest.NewRecorder()
+	h.ServeHTTP(resp, req)
+	c.Check(resp.Code, check.Equals, http.StatusOK)
+	c.Check(keepclient.DefaultBlockCache.MaxBlocks, check.Equals, cfg.cluster.Collections.WebDAVCache.MaxBlockEntries)
+}
+
 func (s *UnitSuite) TestCORSPreflight(c *check.C) {
 	h := handler{Config: newConfig(s.Config)}
 	u := mustParseURL("http://keep-web.example/c=" + arvadostest.FooCollection + "/foo")

commit a136c1ca723537feab8efb40de4fe68c099a175b
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Tue Aug 13 14:12:59 2019 -0300

    10998: Adds Collections.WebDAVCache.MaxBlockEntries config knob.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/lib/config/config.default.yml b/lib/config/config.default.yml
index 2c0b53016..dfdd03104 100644
--- a/lib/config/config.default.yml
+++ b/lib/config/config.default.yml
@@ -395,6 +395,7 @@ Clusters:
       # Cache parameters for WebDAV content serving:
       # * TTL: Maximum time to cache manifests and permission checks.
       # * UUIDTTL: Maximum time to cache collection state.
+      # * MaxBlockEntries: Maximum number of block cache entries.
       # * MaxCollectionEntries: Maximum number of collection cache entries.
       # * MaxCollectionBytes: Approximate memory limit for collection cache.
       # * MaxPermissionEntries: Maximum number of permission cache entries.
@@ -402,6 +403,7 @@ Clusters:
       WebDAVCache:
         TTL: 300s
         UUIDTTL: 5s
+        MaxBlockEntries:      4
         MaxCollectionEntries: 1000
         MaxCollectionBytes:   100000000
         MaxPermissionEntries: 1000
diff --git a/lib/config/generated_config.go b/lib/config/generated_config.go
index 5341a256c..6cb8bf81a 100644
--- a/lib/config/generated_config.go
+++ b/lib/config/generated_config.go
@@ -401,6 +401,7 @@ Clusters:
       # Cache parameters for WebDAV content serving:
       # * TTL: Maximum time to cache manifests and permission checks.
       # * UUIDTTL: Maximum time to cache collection state.
+      # * MaxBlockEntries: Maximum number of block cache entries.
       # * MaxCollectionEntries: Maximum number of collection cache entries.
       # * MaxCollectionBytes: Approximate memory limit for collection cache.
       # * MaxPermissionEntries: Maximum number of permission cache entries.
@@ -408,6 +409,7 @@ Clusters:
       WebDAVCache:
         TTL: 300s
         UUIDTTL: 5s
+        MaxBlockEntries:      4
         MaxCollectionEntries: 1000
         MaxCollectionBytes:   100000000
         MaxPermissionEntries: 1000
diff --git a/sdk/go/arvados/config.go b/sdk/go/arvados/config.go
index db4e6dcd8..02043fb6d 100644
--- a/sdk/go/arvados/config.go
+++ b/sdk/go/arvados/config.go
@@ -60,6 +60,7 @@ func (sc *Config) GetCluster(clusterID string) (*Cluster, error) {
 type WebDAVCacheConfig struct {
 	TTL                  Duration
 	UUIDTTL              Duration
+	MaxBlockEntries      int
 	MaxCollectionEntries int
 	MaxCollectionBytes   int64
 	MaxPermissionEntries int

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list