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

InterProcessMutex doesn't clean up after interrupt

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0.0-incubating, 2.1.0-incubating, 2.2.0-incubating, 2.3.0
    • 2.7.0
    • None
    • None

    Description

      InterProcessMutex can deadlock if a thread is interrupted during acquire(). Specifically, CreateBuilderImpl.pathInForeground submits a create request to ZooKeeper, and an InterruptedException is thrown after the node is created in ZK but before ZK.create returns. ZK.create propagates a non-KeeperException, so Curator assumes the create has failed, but does not retry, and the node is now orphaned. At some point in the future, the node becomes the next in the acquisition sequence, but is not reclaimed as the ZK session has not expired.

      <stack trace attached in comments below>

      Curator should catch the InterruptedException and other non-KeeperExceptions, and delete the created node before propagating these exceptions.

      (as originally discussed on https://groups.google.com/forum/#!topic/curator-users/9ii5of8SbdQ)

      Attachments

        Activity

          People

            randgalt Jordan Zimmerman
            ortschun Orcun Simsek
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: