You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Rakesh R (Commented) (JIRA)" <ji...@apache.org> on 2012/03/06 13:10:59 UTC

[jira] [Commented] (ZOOKEEPER-1405) leader election recipe sample code - dispatchEvent invocations can get out of order

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

Rakesh R commented on ZOOKEEPER-1405:
-------------------------------------

Hi Robert,

Please go through 'ZOOKEEPER-1209', few problems which I have observed in the recipe usage. Hope this will help in identifying more usecases and help to strengthen our recipes .
                
> leader election recipe sample code - dispatchEvent invocations can get out of order
> -----------------------------------------------------------------------------------
>
>                 Key: ZOOKEEPER-1405
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1405
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: recipes
>    Affects Versions: 3.4.3
>            Reporter: Robert Varga
>
> Since the process method is not synchronized in org.apache.zookeeper.recipes.election.LeaderElectionSupport, therefore there is a race condition where events coming in from the watch may overtake the events dispatched during the start method. 
> A solution to ensure that events dispatched during the start method are handled before any watch-based events is to make the process method synchronized.

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