jerryshao commented on code in PR #7463:
URL: https://github.com/apache/gravitino/pull/7463#discussion_r2163636657
##########
core/src/main/java/org/apache/gravitino/cache/CaffeineEntityCache.java:
##########
@@ -172,20 +172,20 @@ public boolean invalidate(NameIdentifier ident,
Entity.EntityType type) {
public boolean contains(
NameIdentifier ident, Entity.EntityType type,
SupportsRelationOperations.Type relType) {
checkArguments(ident, type, relType);
- return cacheData.getIfPresent(EntityCacheKey.of(ident, type, relType)) !=
null;
+ return withLock(() -> cacheData.getIfPresent(EntityCacheKey.of(ident,
type, relType)) != null);
Review Comment:
Why do we need to add a lock here?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]