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

merged 5 commits into from Jan 5, 2017


None yet

2 participants


Use a global LRU for routes matching during function calls


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.

@@ -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 Jan 3, 2017 Contributor

Why the duplication here?

+ return
+// Delete ...
ccirello Jan 3, 2017 Contributor

function description is missing.

@@ -99,5 +99,8 @@ func (s *Server) handleRouteCreate(c *gin.Context) {
+ // For any create just push the new route to the front of the list
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
+For: api/server/singleflight.go
ccirello Jan 5, 2017 Contributor

Still duplicated...

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

2 checks passed

ci/circleci Your tests passed on CircleCI!
licence/cla Contributor License Agreement is signed.
@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