Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-5669

Storage#tryLock() should check for null before logging successfull message

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.5.0
    • Component/s: datanode
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      In the following code in Storage#tryLock(), there is a possibility that file.getChannel().tryLock() returns null if the lock is acquired by some other process. In that case even though return value is null, a successfull message confuses.

      try {
              res = file.getChannel().tryLock();
              file.write(jvmName.getBytes(Charsets.UTF_8));
              LOG.info("Lock on " + lockF + " acquired by nodename " + jvmName);
            } catch(OverlappingFileLockException oe) {

        Attachments

        1. HDFS-5669.patch
          2 kB
          Vinayakumar B
        2. HDFS-5669.patch
          1 kB
          Vinayakumar B

          Activity

            People

            • Assignee:
              vinayakumarb Vinayakumar B
              Reporter:
              vinayakumarb Vinayakumar B
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: