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

Measure thread running time precisely

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.0
    • None
    • None

    Description

      Currently, the code uses `System.currentTimeMillis()` to measure timeout extensively. However, many situations trigger the thread suspend such as gc and context switch. In such cases, the timeout value we specify is not strictly honored. I believe many of flaky tests failed with timed-out are a result of this. Maybe we should use ThreadMXBean#getCurrentThreadCpuTime to precisely measure the thread running time.

      Attachments

        Activity

          People

            Unassigned Unassigned
            huxi_2b huxihx
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: