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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.2.0
    • 2.5.0
    • datanode
    • None
    • 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

            vinayakumarb Vinayakumar B
            vinayakumarb Vinayakumar B
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: