You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "Ryan0751 (via GitHub)" <gi...@apache.org> on 2023/09/13 17:31:54 UTC

[GitHub] [curator] Ryan0751 commented on a diff in pull request #479: Curator 690. curator cache fails to load the cache if there are more than 64 k child z nodes

Ryan0751 commented on code in PR #479:
URL: https://github.com/apache/curator/pull/479#discussion_r1324850074


##########
curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/CuratorCacheImpl.java:
##########
@@ -59,14 +59,29 @@ class CuratorCacheImpl implements CuratorCache, CuratorCacheBridge {
     private final StandardListenerManager<CuratorCacheListener> listenerManager = StandardListenerManager.standard();
     private final Consumer<Exception> exceptionHandler;
 
-    private final Phaser outstandingOps = new Phaser() {
+    private final Phaser rootPhaser = new Phaser() {
         @Override
         protected boolean onAdvance(int phase, int registeredParties) {
             callListeners(CuratorCacheListener::initialized);
+            synchronized (CuratorCacheImpl.this) {
+                currentChildPhaser = rootPhaser; 
+            } 
             return true;
         }
     };
 
+    private Phaser currentChildPhaser = new Phaser(rootPhaser);
+
+    private synchronized Phaser getPhaserAndRegister() {
+        if (currentChildPhaser.getRegisteredParties() >= 0xffff) {
+            currentChildPhaser = new Phaser(rootPhaser);

Review Comment:
   Is there a reason to prefer chain of child phasers versus a single layer deep tree off the single parent root phaser?
   
   I suppose a tree has a limit of 64k children, but that should support 172x10^9 ZNodes.



-- 
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: commits-unsubscribe@curator.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org