ZooKeeper
  1. ZooKeeper
  2. ZOOKEEPER-1405

leader election recipe sample code - dispatchEvent invocations can get out of order

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 3.4.3
    • Fix Version/s: None
    • Component/s: recipes
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Rakesh R added a comment -

        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 .

        Show
        Rakesh R added a comment - 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 .
        Robert Varga created issue -

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert Varga
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development