Add global lru for routes with keys being the appname + path #472

Merged
merged 5 commits into from Jan 5, 2017

Projects

None yet

2 participants

@seiflotfy
Contributor

Use a global LRU for routes matching during function calls

@ccirello

This shall be OK for single-node deployments. On a multi-node deployment, we need somehow to be able to invalidate local node's cache whenever the DB gets updated by some other entity/node.

THIRD_PARTY
@@ -5,4 +5,8 @@ Copyright 2013 Julien Schmidt. All rights reserved. BSD-license
For: api/server/internal/routecache/lru.go
For: api/server/singleflight.go
+Copyright 2012 Google Inc. All rights reserved. Apache 2 license
@ccirello
ccirello Jan 3, 2017 Contributor

Why the duplication here?

api/server/internal/routecache/lru.go
+ return
+}
+
+// Delete ...
@ccirello
ccirello Jan 3, 2017 Contributor

function description is missing.

api/server/routes_create.go
@@ -99,5 +99,8 @@ func (s *Server) handleRouteCreate(c *gin.Context) {
return
}
+ // For any create just push the new route to the front of the list
@ccirello
ccirello Jan 3, 2017 Contributor

Is this comment really necessary? it seems quite self-evident for me that Refresh will push the new route to the front of the list.

seiflotfy added some commits Jan 3, 2017
@seiflotfy seiflotfy Add global lru for routes with keys being the appname + path fb2138a
@seiflotfy seiflotfy minor comment fixes
8e714aa
THIRD_PARTY
+For: api/server/singleflight.go
@ccirello
ccirello Jan 5, 2017 Contributor

Still duplicated...

seiflotfy and others added some commits Jan 5, 2017
@seiflotfy seiflotfy remove duplicate entires from THIRD_PARTY
226d59b
@seiflotfy seiflotfy Make sure that we lock and unlock on get, refresh and delete on the c…
…ache
6a336ea
@ccirello ccirello Merge branch 'master' into globallru
93f23fb
@ccirello ccirello merged commit 6f8e946 into master Jan 5, 2017

2 checks passed

ci/circleci Your tests passed on CircleCI!
Details
licence/cla Contributor License Agreement is signed.
Details
@ccirello ccirello deleted the globallru branch Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment