Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-9193

org.apache.kafka.common.utils.Timer should use monotonic clock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      utils.Timer uses System.currentTimeMillis to implement blocking methods with timeouts. We should not rely on a non-monotonic clock and should instead switch this to Time.hiResClockMs() (which uses System.nanoTime).

      When we do so we should revert https://github.com/apache/kafka/pull/7683 which was caused by inaccuracies in our current approach (the test was good, the code is bad).

      Attachments

        Activity

          People

            Unassigned Unassigned
            lucasbradstreet Lucas Bradstreet
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: