[crac] RFR: Correct System.nanotime() value after restore [v6]

Jan Kratochvil duke at openjdk.org
Thu May 11 14:43:35 UTC 2023


On Thu, 27 Apr 2023 11:55:53 GMT, Radim Vansa <duke at openjdk.org> wrote:

>> There are various places both inside JDK and in libraries that rely on monotonicity of `System.nanotime()`. When the process is restored on a different machine the value will likely differ as the implementation provides time since machine boot. This PR records wall clock time before checkpoint and after restore and tries to adjust the value provided by nanotime() to reasonably correct value.
>
> Radim Vansa has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Use image under ghcr.io/crac

test/jdk/jdk/crac/java/lang/System/NanoTimeTest.java line 121:

> 119:         assertGTE(boottimeAfter, boottimeBefore + 86_400_000, "Boottime was not changed");
> 120:         RuntimeMXBean runtimeMX = ManagementFactory.getRuntimeMXBean();
> 121:         assertGTE(runtimeMX.getUptime(), 0L,"VM Uptime is negative!");

whitespace

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

PR Review Comment: https://git.openjdk.org/crac/pull/53#discussion_r1191281406


More information about the crac-dev mailing list