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

InetAddress$Cache should replace currentTimeMillis with nanoTime for more precise and accurate

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7, 8
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b29
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        This CR is filed to replace currentTimeMillis with nanoTime in InetAddress$Cache, reasons are below:
        1. It has been confirmed that on certain Vitrual Machines the wall clock time (System.currentTimeMillis) is not advancing by the exected sleep() time. This plays havoc with the internal negative lookup cache mechanism in InetAddress ( which uses currentTimeMillis ). If the negative cache is set for 15 seconds, sleeping for 16 seconds will not guarantee that the cache will be invalidated! see CR7148829
        2. Compared with currentTimeMillis, the nanoTime is only be used to measure elapsed time and not related to any other notion of system or wall-clock time.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ewang Eric Wang (Inactive)
                Reporter:
                ewang Eric Wang (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: