eolivelli commented on a change in pull request #12896:
URL: https://github.com/apache/pulsar/pull/12896#discussion_r755826887
##########
File path:
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/MetadataCacheTest.java
##########
@@ -324,13 +324,14 @@ public void insertionOutsideCache(String provider,
Supplier<String> urlSupplier)
}
@Test(dataProvider = "impl")
- public void insertionOutsideCacheWithGenericType(String provider,
Supplier<String> urlSupplier) throws Exception {
+ public void updateOutsideCacheWithGenericType(String provider,
Supplier<String> urlSupplier) throws Exception {
Review comment:
why are you changing an existing test ?
can we add a new test ?
how are you verifying your change ?
##########
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)`
--
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]