[crac] RFR: Correct System.nanotime() value after restore
Ashutosh Mehra
duke at openjdk.org
Tue Mar 28 14:24:47 UTC 2023
On Tue, 28 Mar 2023 07:14:38 GMT, Radim Vansa <duke at openjdk.org> wrote:
> I am rather worried about moving the process to another system and getting totally nonsense results from nanotime diffs, and broken code.
@rvansa I am assuming you are seeing time going backwards with System.nanoTime() calls after restore. Is that correct?
Its interesting if you are seeing such absurd results after restore, because IIUC criu is using time namespace to update the clock offsets in `/proc/<pid>/timens_offsets`, so I wouldn't expect System.nanoTime() to give absurd results on restore.
I did some tests with C program that call `clock_gettime(CLOCK_MONOTONIC)` before and after restore. In between I restarted my system. I didn't see time going backwards; all I could observe is that the elapsed time between checkpoint and restore was not taken into account.
Can you please provide more details about your observation on nonsense results. Does the system where the absurd behavior is observed support time namepace ? Which version of criu did you use?
-------------
PR Comment: https://git.openjdk.org/crac/pull/53#issuecomment-1486989848
More information about the crac-dev
mailing list