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

Reentrant lock() before try

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.1.0
    • 3.3.0
    • yarn
    • 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

        Issue Links

          Activity

            People

              prabhujoseph Prabhu Joseph
              prabhujoseph Prabhu Joseph
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: