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

Radim Vansa duke at openjdk.org
Thu Apr 20 08:28:40 UTC 2023


On Thu, 20 Apr 2023 08:09:26 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:
> 
>   Set nanotime only if bootid changes

I've updated the PR to change nanotime only if machine `boot_id` changes, and always record the millis + nanos combo before checkpoint. Now I use `ghcr.io/rvansa/crac-test-base` image as the base for tests (we need some native libraries on top of Ubuntu), hopefully we'll set up an org-based repository (`ghcr.io/crac/test-base`) and I'll change update it in the PR.

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

PR Comment: https://git.openjdk.org/crac/pull/53#issuecomment-1515927515


More information about the crac-dev mailing list