Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8165437

Evaluate the use of gettimeofday in Networking code

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7, 8
    • Fix Version/s: 10
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b07

      Description

      The Networking native code uses gettimeofday() in several places to manage timeouts. It may not the best solution because:

        a) any active time-adjusting process (ntpd etc) will cause hard-to-reproduce hangs. Virtual and clusters environment is especially vulnerable to this problem.

        b) despite some optimization gettimeofday() remains expensive call as it typically requires access to hardware clock

      An alternative is to manage timeout in socket code by using select(),
      acceptable solution is clock_gettime() / mach_absolute_time()

      This issue was raise during the review of JDK-8075484 :
         http://mail.openjdk.java.net/pipermail/net-dev/2016-September/010201.html
       

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vtewari Vyom Tewari
                Reporter:
                chegar Chris Hegarty
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: