Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-19378

"hive.lock.numretries" Is Misleading

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 2.4.0, 3.0.0
    • None
    • HiveServer2
    • None

    Description

      Configuration 'hive.lock.numretries' is confusing.  It's not actually a 'retry' count, it's the total number of attempt to try:

       

      ZooKeeperHiveLockManager.java
      do {
            lastException = null;
            tryNum++;
            try {
              if (tryNum > 1) {
                Thread.sleep(sleepTime);
                prepareRetry();
              }
              ret = lockPrimitive(key, mode, keepAlive, parentCreated, conflictingLocks);
      ...
      } while (tryNum < numRetriesForLock);
      

      So, from this code you can see that on the first loop, tryNum is set to 1, in which case, if the configuration num*retries* is set to 1, there will be one attempt total. With a retry value of 1, I would assume one initial attempt and one additional retry. Please change to:

      while (tryNum <= numRetriesForLock);
      

      Attachments

        1. HIVE-19378.1.patch
          3 kB
          Alice Fan

        Activity

          People

            afan Alice Fan
            belugabehr David Mollitor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: