curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randgalt <...@git.apache.org>
Subject [GitHub] curator issue #193: [CURATOR-311] SharedValue could hold stall data when quo...
Date Tue, 10 Jan 2017 17:06:48 GMT
Github user Randgalt commented on the issue:

    https://github.com/apache/curator/pull/193
  
    I'm -1 on this PR overall. The purpose of `state` internally is not to hold the connection
state. It's to hold the started state of the instanced. Mixing the two is bound to cause problems.

    
    A simpler solution would be:
    
    ```java
        private final ConnectionStateListener connectionStateListener = new ConnectionStateListener()
        {
            @Override
            public void stateChanged(CuratorFramework client, ConnectionState newState)
            {
                notifyListenerOfStateChanged(newState);
                if ( newState == ConnectionState.RECONNECTED )
                {
                    try
                    {
                        readValueAndNotifyListenersInBackground();
                    }
                    catch ( Exception e )
                    {
                        log.error("Could not read value after reconnect", e);
                    }
                }
            }
        };
    ```



---
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