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

The Timestamp for longest write/read lock held log is wrong

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      I found the Timestamp for longest write/read lock held log is wrong in trunk:

      2020-03-10 16:01:26,585 [main] INFO  namenode.FSNamesystem (FSNamesystemLock.java:writeUnlock(281)) - 	Number of suppressed write-lock reports: 0
      	Longest write-lock held at 1970-01-03 07:07:40,841+0900 for 3ms via java.lang.Thread.getStackTrace(Thread.java:1559)
      ...
      

      Looking at the code, it looks like the timestamp comes from System.nanoTime() that returns the current value of the running Java Virtual Machine's high-resolution time source and this method can only be used to measure elapsed time:
      https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#nanoTime--

      We need to make the timestamp from System.currentTimeMillis().

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                brfrn169 Toshihiro Suzuki
                Reporter:
                brfrn169 Toshihiro Suzuki
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: