Uploaded image for project: 'Apache Curator'
  1. Apache Curator
  2. CURATOR-15

LeaderSelector may (undetectably) fail to elect

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.0-incubating
    • None
    • Recipes
    • None

    Description

      In LeaderSelector, if mutex.acquire() throws an Exception, for example because CuratorFramework.getZooKeeper() threw a previously-enqueued background exception, then that failure will propagate out of doWork and doWorkLoop, and kill the background submission onto the executor service.

      This means that a leaderselector which was start()ed will NEVER elect, and this situation is NOT DETECTABLE externally, since that exception happens on a private executorservice thread and is not client visible. It's impossible to look at a LeaderSelector and decide whether it is still "viable".

      This can leave a machine/process "hung" and not automatically recoverable within curator.

      Either isQueued() needs to be exposed, which means that a leader is either elected or queued; or the finally{} block which calls clearIsQueued() needs also to set state to CLOSED or FAILED, so that we can query this failure externally.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              arren Shevek
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: