Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-19501

GraalLibc.gettimeofday() is misbehaving in new GraalVM versions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Triage Needed
    • Normal
    • Resolution: Unresolved
    • None
    • Client/java-driver
    • 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().

      Attachments

        Activity

          People

            Unassigned Unassigned
            absurdfarce Bret McGuire
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: