You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/09/13 14:56:53 UTC
[GitHub] [curator] tisonkun 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
tisonkun commented on code in PR #479:
URL: https://github.com/apache/curator/pull/479#discussion_r1324654459
##########
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:
```suggestion
currentChildPhaser = new Phaser(currentChildPhaser);
```
?
--
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