[crac] RFR: 8354432: [CRaC] Timed waiting finishes early w.r.t. wall clock time

Timofei Pushkin tpushkin at openjdk.org
Fri Apr 11 14:50:35 UTC 2025


This is an alternative to #209 that also fixes `TimedWaitingTest`.

The solution is to offset `os::javaTimeNanos()` using nanosecond-precision wall clock time instead of millisecond-precision. See the explanation in the related JBS issue.

I've run the test 100 times in CI and haven't witnessed it failing. To compare, without the fix it would usually fail in the first 5-10 runs.

-------------

Commit messages:
 - Make nanoTime offsetting more precise

Changes: https://git.openjdk.org/crac/pull/221/files
  Webrev: https://webrevs.openjdk.org/?repo=crac&pr=221&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8354432
  Stats: 20 lines in 2 files changed: 8 ins; 0 del; 12 mod
  Patch: https://git.openjdk.org/crac/pull/221.diff
  Fetch: git fetch https://git.openjdk.org/crac.git pull/221/head:pull/221

PR: https://git.openjdk.org/crac/pull/221


More information about the crac-dev mailing list