[crac] RFR: 8354432: [CRaC] Timed waiting finishes early w.r.t. wall clock time [v2]
Radim Vansa
rvansa at openjdk.org
Mon Apr 14 13:14:21 UTC 2025
On Mon, 14 Apr 2025 11:03:38 GMT, Timofei Pushkin <tpushkin at openjdk.org> wrote:
>> 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.
>
> Timofei Pushkin has updated the pull request incrementally with one additional commit since the last revision:
>
> Move docs to header
Great analysis, I am glad that we could have that test finally working! The change looks good.
Originally you thought that the wallclock time is adjusting backwards; since the test enforces the first branch, I think it is still proof against going back during the checkpoint. The test would really fail if going back between checkpoint and the end of 1000 ms wait, correct?
LGTM!
src/hotspot/share/runtime/crac.cpp line 62:
> 60: CracEngine *crac::_engine = nullptr;
> 61: // Timestamps recorded before checkpoint
> 62: jlong crac::checkpoint_wallclock_seconds; // Wall clock time, full seconds
Not even a nitpick: I wonder if we should document private fields here or in the header file, WDYT? (I stand guilty for having docs for `javaTimeNanos_offset` here...).
-------------
Marked as reviewed by rvansa (Committer).
PR Review: https://git.openjdk.org/crac/pull/221#pullrequestreview-2763299969
PR Review: https://git.openjdk.org/crac/pull/221#pullrequestreview-2763744116
PR Review Comment: https://git.openjdk.org/crac/pull/221#discussion_r2041516657
More information about the crac-dev
mailing list