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

Background protected mode incorrectly sets Event name to just ZNode name. Should be full path.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 2.7.0
    • 2.8.0
    • Recipes
    • None
    • operating system:ubuntu

    Description

      We use LeaderLatch for leader election within our several zookeeper clients,but sometimes our leaderLatch stopped to work due to a error "Background exception was not retry-able or retry gave up java.lang.IllegalArgumentException: Path must start with / characte".

      To found the reason we tracked the execution of program in class LeaderLatch with debug mode,we found the code "setNode(event.getName());" in line 487 of LeaderLatch.class in which "event.getName()" code sometimes didn't return the full path of the znode but only return the last part of the full path,like "_c_b1097329-4a77-493b-806c-5c888067eeab-latch-0000004068", but the full path should be "/api1/leaders/_c_b1097329-4a77-493b-806c-5c888067eeab-latch-0000004068".

      So the when event.getName()=="_c_b1097329-4a77-493b-806c-5c888067eeab-latch-0000004068", the program will fail to go through the codes below:
      1.LeaderLatch.checkLeadership() line 526
      2.ZKPaths.getNodeFromPath() line 61
      3.PathUtils.validatePath(path) line 46
      And then the LeaderLatch stopped to work.

      Attachments

        1. CURATOR-168.patch
          0.7 kB
          Mike Drob

        Issue Links

          Activity

            People

              Unassigned Unassigned
              zhaogang zhaogang
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 168h
                  168h
                  Remaining:
                  Remaining Estimate - 168h
                  168h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified