curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dragonsinth <...@git.apache.org>
Subject [GitHub] curator pull request: TreeCache should inform listeners when its f...
Date Wed, 22 Jul 2015 21:43:15 GMT
Github user dragonsinth commented on a diff in the pull request:

    https://github.com/apache/curator/pull/92#discussion_r35267885
  
    --- Diff: curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
---
    @@ -758,6 +758,7 @@ private void handleStateChange(ConnectionState newState)
                 break;
     
             case LOST:
    --- End diff --
    
    Let me ramble a bit on my thinking, and hopefully you can help me clarify my thinking.
    
    My intent is to follow the semantics around leaders/locks/leases/ephemeral nodes.  My
intuition is that I should be seeing a LOST event right about the same time the server considers
my session to be timed out.  So I want to inform TreeCache listeners here that they can no
longer trust the internal tree state as being reasonably up to date.  Once the connection
is re-established, I then re-walk the tree to synchronize to the server, after which I re-publish
INITIALIZED, to inform listeners that they can now reasonably trust the tree state.
    
    The use case I want to support is when someone is using TreeCache to watch for tree changes
while using the same client to (say) put ephemeral nodes into the Tree.  The semantic I want
to convey is that you can only trust that those nodes are really there if the TreeCache is
currently in an initialized state.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message