[ 
https://issues.apache.org/jira/browse/CURATOR-49?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13722696#comment-13722696
 ] 

Jordan Zimmerman commented on CURATOR-49:
-----------------------------------------

Why are you manually deleting the node? You should not manually change nodes 
that have been given to Curator recipes. Please see this: 
https://cwiki.apache.org/confluence/display/CURATOR/TN7
                
> LeaderSelector has no response when delete the leader node by other clients
> ---------------------------------------------------------------------------
>
>                 Key: CURATOR-49
>                 URL: https://issues.apache.org/jira/browse/CURATOR-49
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Recipes
>    Affects Versions: 2.1.0-incubating
>         Environment: curator-recipes 2.1.0-incubating and  zookeeper 3.4.5
>            Reporter: Ding Jinqiang
>
> If I setup a normal LeaderSelection with two participants, and as expected 
> one of them becomes the leader. But when I delete the leader node manually by 
> other clients, the other leaderSelector becomes the leader normally. But the 
> leaderSelector, which is the previous leader, does not receive any 
> notification in the LeaderSelectorListener. 
> Well, my question is, is this normal, or I just missed something? 
> Sample code may like this:
>               RetryPolicy retryPolicy = new ExponentialBackoffRetry(1000, 1);
>               client = 
> CuratorFrameworkFactory.newClient(Config.getInstance().getServerConnectString(),
>                               retryPolicy);
>               client.start();
>               LeaderSelectorListener listener = new LeaderSelectorListener() {
>                       @Override
>                       public void takeLeadership(CuratorFramework client) 
> throws Exception {
>                               logger.info("takeLeadership, thread 
> id:"+Thread.currentThread().getId());
>                               Thread.sleep(Long.MAX_VALUE);
>                       }
>                       @Override
>                       public void stateChanged(CuratorFramework client, 
> ConnectionState newState) {
>                               logger.info("Zookeeper connection stateChanged, 
> new state is " + newState);
>                       }
>               };
>               selector = new LeaderSelector(client, 
> Config.getInstance().getEclectPath());
>               selector.autoRequeue();
>               selector.start();
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to