incubator-s4-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthieu Morel (JIRA)" <j...@apache.org>
Subject [jira] [Assigned] (S4-85) Improve handling of ZK connection changes
Date Fri, 20 Jul 2012 13:38:33 GMT

     [ https://issues.apache.org/jira/browse/S4-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Matthieu Morel reassigned S4-85:
--------------------------------

    Assignee: Matthieu Morel
    
> Improve handling of ZK connection changes 
> ------------------------------------------
>
>                 Key: S4-85
>                 URL: https://issues.apache.org/jira/browse/S4-85
>             Project: Apache S4
>          Issue Type: Improvement
>    Affects Versions: 0.5
>            Reporter: Daniel Gómez Ferro
>            Assignee: Matthieu Morel
>             Fix For: 0.5
>
>
> Currently we are handling ZK state changes a bit differently in two places.
> org.apache.s4.comm.topology.AssignmentFromZK:
> {code}
>     @Override
>     public void handleStateChanged(KeeperState state) throws Exception {
>         this.state = state;
>         if (!state.equals(KeeperState.SyncConnected)) {
>             logger.warn("Session not connected for cluster [{}]: [{}]. Trying to reconnect",
clusterName, state.name());
>             zkClient.close();
>             zkClient.connect(connectionTimeout, null);
>             handleNewSession();
>         }
>     }
> {code}
> org.apache.s4.comm.topology.ClusterFromZK:
> {code}
>     @Override
>     public void handleStateChanged(KeeperState state) throws Exception {
>         this.state = state;
>         if (!state.equals(KeeperState.SyncConnected)) {
>             logger.warn("Session not connected for cluster [{}]: [{}]. Trying to reconnect",
clusterName, state.name());
>             zkClient.connect(connectionTimeout, null);
>             handleNewSession();
>         }
>     }
> {code}
> In the first case we explicitly close the connection before trying to reconnect. Furthermore,
I think we should only try to reconnect when the state is equals to {{KeeperState.Expired}},
since now we are closing the connection on a {{Disconnected}} event too.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message