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

java.net.InetAddress unexpectedly clears Interrupted-State of current Thread

    XMLWordPrintable

Details

    • generic
    • generic

    Description

      FULL PRODUCT VERSION :
      java version "1.8.0_45"
      Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
      Java HotSpot(TM) Client VM (build 25.45-b02, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      The Problem occurs, if a running Thread, which uses java.net.InetAddress is being interrupted by another class.
      The thread is expected to throw an InterruptedException and stop its execution, but instead the interrupt() call is ignored.

      The lines which are most likely responsible for this unexpected behavior are:

      InetAddress.java:1391:
      ----------------------------------------------------------------------------
      while (lookupTable.containsKey(host)) {
      try {
      lookupTable.wait();
      } catch (InterruptedException e) {
      }
      }
      ----------------------------------------------------------------------------


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
       - One thread is constantly trying to resolve an unknown host by calling InetAddress.getByName(host)
       - The resolve loop stops once the thread is being interrupted by another thread.
       - Now another thread calls interrupt()
       - In some cases, the InterruptedException is ignored and does not lead to a stop of the loop

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Calling interrupt() on a thread is expected to trigger an InterruptedException.
      ACTUAL -
      The InterruptedException is being ignored.

      REPRODUCIBILITY :
      This bug can be reproduced occasionally.

      Attachments

        Issue Links

          Activity

            People

              psonal Pallavi Sonal (Inactive)
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: