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

Concurrency issue in LockInternals

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 2.12.0
    • None
    • Recipes
    • None
    • Curator 2.12.0
      zookeeper 3.4.14

    Description

      I'm using InterProcessMutex and InterProcessMutex often failed to acquire lock.

      In LockInternals.internalLockLoop(), watcher is registered to zookeeper and call wait() like below

      client.getData().usingWatcher(watcher).forPath(previousSequencePath);
      if ( millisToWait != null )
      {
          millisToWait -= (System.currentTimeMillis() - startMillis);
          startMillis = System.currentTimeMillis();
          if ( millisToWait <= 0 )
          {
              doDelete = true;    // timed out - delete our node
              break;
          }
      
          wait(millisToWait);
      }
      else
      {
          wait();
      }
      

      In my case, my program is waiting previousSequencePath=_c_f290140d-9856-42ad-b9bf-348ffc086062-lock-0000000759 to be deleted.

      But _c_f290140d-9856-42ad-b9bf-348ffc086062-lock-0000000759 is deleted between client.getData() and wait().

      if _c_f290140d-9856-42ad-b9bf-348ffc086062-lock-0000000759 is deleted when 
      client.getData().usingWatcher(watcher).forPath(previousSequencePath) is called, it will throw Exception but it was exist at that time.

      I'm using Curator 2.12.0 but latest version seems to have same issue.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jc5201 Jaechang Kim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: