Skip to content

Commit

Permalink
Addressing comment
Browse files Browse the repository at this point in the history
Signed-off-by: Sagar Upadhyaya <upasagar@amazon.com>
  • Loading branch information
Sagar Upadhyaya committed Jun 26, 2024
1 parent 5e020b8 commit a8825a7
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,20 +249,18 @@ private V compute(ICacheKey<K> key, LoadAwareCacheLoader<ICacheKey<K>, V> loader
if (pair != null) {
try (ReleasableLock ignore = writeLock.acquire()) {
onHeapCache.put(pair.v1(), pair.v2());
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
} catch (Exception e) {
// TODO: Catch specific exceptions to know whether this resulted from cache or underlying removal
// listeners/stats. Needs better exception handling at underlying layers.For now swallowing
// exception.
logger.warn("Exception occurred while putting item onto heap cache", e);
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
}
} else {
if (ex != null) {
logger.warn("Exception occurred while trying to compute the value", ex);
}
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
}
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
return null;
};
V value = null;
Expand Down

0 comments on commit a8825a7

Please sign in to comment.