Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-3640

Don't use Util#now or System#currentTimeMillis for calculating intervals

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0-alpha
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Target Version/s:

      Description

      Per HDFS-3485 we shouldn't use Util#now or System#currentTimeMillis to calculate intervals as they can be affected by system clock changes.

        Issue Links

          Activity

          Hide
          Andy Isaacson added a comment -

          There is a subtle distinction here, between cases where timeofday should be used and cases where monotonic time should be used. Both have their place in a distributed system.

          If a timer is used to compute a delay period as in HDFS-3485, then it's important to use monotonic time.

          If a clock is used to generate a time, or a unique identifier, or an opaque token that is written to a persistent store or sent over the wire to another node (even if in an "opaque" object), then it's important to use timeofday.

          Show
          Andy Isaacson added a comment - There is a subtle distinction here, between cases where timeofday should be used and cases where monotonic time should be used. Both have their place in a distributed system. If a timer is used to compute a delay period as in HDFS-3485 , then it's important to use monotonic time. If a clock is used to generate a time, or a unique identifier, or an opaque token that is written to a persistent store or sent over the wire to another node (even if in an "opaque" object), then it's important to use timeofday .

            People

            • Assignee:
              Unassigned
              Reporter:
              Eli Collins
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:

                Development