Skip to content

Commit a8825a7

Browse files
author
Sagar Upadhyaya
committed
Addressing comment
Signed-off-by: Sagar Upadhyaya <[email protected]>
1 parent 5e020b8 commit a8825a7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

modules/cache-common/src/main/java/org/opensearch/cache/common/tier/TieredSpilloverCache.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -249,20 +249,18 @@ private V compute(ICacheKey<K> key, LoadAwareCacheLoader<ICacheKey<K>, V> loader
249249
if (pair != null) {
250250
try (ReleasableLock ignore = writeLock.acquire()) {
251251
onHeapCache.put(pair.v1(), pair.v2());
252-
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
253252
} catch (Exception e) {
254253
// TODO: Catch specific exceptions to know whether this resulted from cache or underlying removal
255254
// listeners/stats. Needs better exception handling at underlying layers.For now swallowing
256255
// exception.
257256
logger.warn("Exception occurred while putting item onto heap cache", e);
258-
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
259257
}
260258
} else {
261259
if (ex != null) {
262260
logger.warn("Exception occurred while trying to compute the value", ex);
263261
}
264-
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
265262
}
263+
completableFutureMap.remove(key);// Remove key from map as not needed anymore.
266264
return null;
267265
};
268266
V value = null;

0 commit comments

Comments
 (0)