hadoop-yarn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prabhu Joseph (JIRA)" <j...@apache.org>
Subject [jira] [Created] (YARN-9341) Reentrant lock() before try
Date Mon, 04 Mar 2019 05:05:00 GMT
Prabhu Joseph created YARN-9341:
-----------------------------------

             Summary: Reentrant lock() before try
                 Key: YARN-9341
                 URL: https://issues.apache.org/jira/browse/YARN-9341
             Project: Hadoop YARN
          Issue Type: Bug
          Components: yarn
    Affects Versions: 3.1.0
            Reporter: Prabhu Joseph
            Assignee: Prabhu Joseph


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.

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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: yarn-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: yarn-dev-help@hadoop.apache.org


Mime
View raw message