Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-17463

Replace currentTimeMillis with monotonicNow in elapsed time

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • None

    Description

      I noticed that there is a widespread incorrect usage of System.currentTimeMillis()  throughout the hadoop code.

      For example:

      // Some comments here
      long start = System.currentTimeMillis();
      while (System.currentTimeMillis() - start < timeout) {
        // Do something
      }
      

      Elapsed time should be measured using `monotonicNow()`.

      Attachments

        Issue Links

          Activity

            People

              ahussein Ahmed Hussein
              ahussein Ahmed Hussein
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 40m
                  1h 40m