raystack/stencil

Guava Cache returns stale values during refresh

chakravarthyvp opened this issue · 1 comments

Stencil uses Guava cache for caching protobufs.
On a get() on a key that is expiring for a refresh, the CacheLoader Async reload from the LocalCache(guava) tries to reload the cache for key, however stale values are returned with the cache not updated.

The reload provides a callable future task which looks like a race condition to cache's parallel get calls. A simple solution is to return a new value synchronously.

Resolved by #4