Details
-
Bug
-
Status: Triage Needed
-
Normal
-
Resolution: Unresolved
-
None
-
None
-
All
-
None
Description
As of JAVA-2663 the Java driver relies on System.nanoTime() for it's impl of Native.gettimeofday() on GraalVM. Underlying rationale there was a substitution on older Substrate impls which appeared to rely on gettimeofday() for it's replacement of System.nanoTime(). This was an unfortunate misreading of the source; it falls back to gettimeofday() iff clock_gettime() on CLOCK_MONOTONIC fails, and on most modern systems that won't fail at all. In fact new versions of GraalVM don't even bother with the fallback.]. That leaves us returning values from the monotonic clock as answers to gettimeofday() ops and those values... do not correlate to the time of day at all.
Seems like the simplest answer is just to inline the gettimeofday() logic into GraalLibc.gettimeofdayRaw().