Jason918 commented on a change in pull request #12896:
URL: https://github.com/apache/pulsar/pull/12896#discussion_r755917562
##########
File path:
pulsar-metadata/src/main/java/org/apache/pulsar/metadata/cache/impl/MetadataCacheImpl.java
##########
@@ -261,8 +261,11 @@ public void invalidate(String path) {
@Override
public void refresh(String path) {
- objCache.synchronous().invalidate(path);
- objCache.synchronous().refresh(path);
+ // Refresh object of path if only it is cached before.
+ if (objCache.getIfPresent(path) != null) {
Review comment:
> we should move this block into a dedicated method of objCache
>
> `objCache.synchronous().invalidateAndRefreshIfPresent(path)`
It's a bit of trouble to do this, because objCache is an instance of class
`com.github.benmanes.caffeine.cache.AsyncCacheLoader` , which is in a dependent
lib.
--
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]