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

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

    XMLWordPrintable

Details

    • b29
    • generic
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: