Skip to content

Commit

Permalink
Reduce churn of cache on revocation_list
Browse files Browse the repository at this point in the history
The explicit call to refresh will cause higher-than-average load
under high counts of revocation events.  The simple invalidate ensures
that we don't re-generate the revocation list on revocation event
but only on-demand.

closes-bug: 1220359
Change-Id: I826778843e344be001bbcc832054a0ad446285e7
  • Loading branch information
Morgan Fainberg committed Sep 10, 2013
1 parent 8dc7ed2 commit a9a1e1a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions keystone/token/core.py
Expand Up @@ -173,13 +173,10 @@ def list_revoked_tokens(self):
return self.driver.list_revoked_tokens()

def invalidate_revocation_list(self):
# NOTE(morganfainberg): we should always be keeping the revoked tokens
# list in memory, calling refresh in this case instead of ensures a
# cache hit when list_revoked_tokens is called again. This is an
# exception to the rule. Note that ``self`` needs to be passed to
# refresh() because of the way the invalidation/refresh methods work on
# NOTE(morganfainberg): Note that ``self`` needs to be passed to
# invalidate() because of the way the invalidation method works on
# determining cache-keys.
self.list_revoked_tokens.refresh(self)
self.list_revoked_tokens.invalidate(self)

def _invalidate_individual_token_cache(self, token_id, belongs_to=None):
# NOTE(morganfainberg): invalidate takes the exact same arguments as
Expand Down

0 comments on commit a9a1e1a

Please sign in to comment.