[ 
https://issues.apache.org/jira/browse/HDFS-10713?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15468265#comment-15468265
 ] 

Arpit Agarwal edited comment on HDFS-10713 at 9/6/16 8:55 PM:
--------------------------------------------------------------

Thanks for the updated patch [~hanishakoneru]. The read lock is not exclusive 
so the following sequence of operations in readUnlock won't see a consistent 
state. This block of code probably needs to synchronize on a separate mutex 
after releasing the read lock. 

{code}
    if (needReport && readLockInterval >= this.readLockReportingThreshold) {
      if (readLockInterval > longestReadLockHeldInterval) {
        longestReadLockHeldInterval = readLockInterval;
      }
      if (currentTime - timeStampOfLastReadLockReport > this
          .lockSuppressWarningInterval) {
        logReport = true;
        numSuppressedWarnings = numReadLockWarningsSuppressed;
        numReadLockWarningsSuppressed = 0;
        longestLockHeldInterval = longestReadLockHeldInterval;
        longestReadLockHeldInterval = 0;
        timeStampOfLastReadLockReport = currentTime;
      } else {
        numReadLockWarningsSuppressed++;
      }
    }

    this.fsLock.readLock().unlock();
{code}

-I also had some questions about the _needReport_ logic I posted on 
HDFS-10817.- 


was (Author: arpitagarwal):
Thanks for the updated patch [~hanishakoneru]. The read lock is not exclusive 
so the following sequence of operations in readUnlock won't see a consistent 
state. This block of code probably needs to synchronize on a separate mutex 
after releasing the read lock. 

{code}
    if (needReport && readLockInterval >= this.readLockReportingThreshold) {
      if (readLockInterval > longestReadLockHeldInterval) {
        longestReadLockHeldInterval = readLockInterval;
      }
      if (currentTime - timeStampOfLastReadLockReport > this
          .lockSuppressWarningInterval) {
        logReport = true;
        numSuppressedWarnings = numReadLockWarningsSuppressed;
        numReadLockWarningsSuppressed = 0;
        longestLockHeldInterval = longestReadLockHeldInterval;
        longestReadLockHeldInterval = 0;
        timeStampOfLastReadLockReport = currentTime;
      } else {
        numReadLockWarningsSuppressed++;
      }
    }

    this.fsLock.readLock().unlock();
{code}

I also had some questions about the _needReport_ logic I posted on HDFS-10817.

> Throttle FsNameSystem lock warnings
> -----------------------------------
>
>                 Key: HDFS-10713
>                 URL: https://issues.apache.org/jira/browse/HDFS-10713
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: logging, namenode
>            Reporter: Arpit Agarwal
>            Assignee: Hanisha Koneru
>         Attachments: HDFS-10713.000.patch, HDFS-10713.001.patch, 
> HDFS-10713.002.patch, HDFS-10713.003.patch
>
>
> The NameNode logs a message if the FSNamesystem write lock is held by a 
> thread for over 1 second. These messages can be throttled to at one most one 
> per x minutes to avoid potentially filling up NN logs. We can also log the 
> number of suppressed notices since the last log message.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to