Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-9341

Reentrant lock() before try

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.1.0
    • Fix Version/s: 3.3.0
    • Component/s: yarn
    • Labels:
      None

      Description

      As a best practice - Reentrant lock has to be acquired before try clause.
      https://stackoverflow.com/questions/31058681/java-locking-structure-best-pattern

      There are many places where lock is obtained inside try.

          try {
             this.writeLock.lock();
            ....
          } finally {
            this.writeLock.unlock();
          }
      

        Attachments

        1. YARN-9341-001.patch
          176 kB
          Prabhu Joseph

          Activity

            People

            • Assignee:
              Prabhu Joseph Prabhu Joseph
              Reporter:
              Prabhu Joseph Prabhu Joseph
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: