Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18441

ZookeeperWatcher#interruptedException should throw exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4.0, 2.0.0, 1.2.7
    • Component/s: Zookeeper
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Currently Zookeeper#interruptedException will swallow the InterruptedException and only log, which might cause unexpected behavior, such as when invoking ZKUtil#checkExists and the watcher thread somehow interrupted, the method will return -1 which means the checked znode doesn't exist, while actually the znode exists.

      We could also see a TODO tag in the javadoc, which indicates we need some fix/improvement here:

        /**
         * Handles InterruptedExceptions in client calls.
         * <p>
         * This may be temporary but for now this gives one place to deal with these.
         * <p>
         * TODO: Currently, this method does nothing.
         *       Is this ever expected to happen?  Do we abort or can we let it run?
         *       Maybe this should be logged as WARN?  It shouldn't happen?
         * <p>
         * @param ie
         */
      

      Here we propose to throw a KeeperException$SystemErrorException in ZookeeperWatcher#interruptedException, and will add a UT case to cover the interruption scenario.

        Attachments

        1. HBASE-18441.trivial.patch
          5 kB
          Yu Li
        2. HBASE-18441.patch
          4 kB
          Yu Li

          Issue Links

            Activity

              People

              • Assignee:
                liyu Yu Li
                Reporter:
                liyu Yu Li
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: