merlimat closed pull request #2785: Refresh ZK cache based on insertion time rather than access URL: https://github.com/apache/pulsar/pull/2785
This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java b/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java index fed55c3eb6..0e69c8806c 100644 --- a/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java +++ b/pulsar-zookeeper-utils/src/main/java/org/apache/pulsar/zookeeper/ZooKeeperCache.java @@ -93,11 +93,11 @@ public ZooKeeperCache(ZooKeeper zkSession, OrderedExecutor executor) { this.zkSession.set(zkSession); this.shouldShutdownExecutor = false; - this.dataCache = Caffeine.newBuilder().expireAfterAccess(1, TimeUnit.HOURS) + this.dataCache = Caffeine.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES) .buildAsync((key, executor1) -> null); - this.childrenCache = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build(); - this.existsCache = CacheBuilder.newBuilder().expireAfterAccess(1, TimeUnit.HOURS).build(); + this.childrenCache = CacheBuilder.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build(); + this.existsCache = CacheBuilder.newBuilder().expireAfterWrite(5, TimeUnit.MINUTES).build(); } public ZooKeeperCache(ZooKeeper zkSession) { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services