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

Connect stress test shows incomplete finishes, Bad file number errors

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • core-libs
    • None
    • beta
    • generic
    • generic
    • Verified

      A socketchannel connect test is setup up to loop 2000
      times but never completes at that scale on Solaris or
      Windows. On Solaris, the first two or three executions
      fail ~500, with an IOException: too many open files.
      Subsequent executions then fail around ~300 iterations
      with either a SocketException or an IOException each with
      the message: Bad file number.

      Reliability increases as the iteration loop
      gets smaller. At 500 there are more completions,
      no open file errors, but the same variety of
      Socket and IOExceptions occur when reexecuted.
      A loop of 200 iterations of this test consistently
      completes without error.

      output from the exceptions:

      java.io.IOException: Too many open files
              at sun.nio.ch.IOUtil.initPipe(Native Method)
              at sun.nio.ch.SelectorImpl.<init>(SelectorImpl.java:67)
              at sun.nio.ch.SelectorProviderImpl.openSelector(SelectorProviderImpl.java:33)
              at conScaleTest.<init>(conScaleTest.java:24)
              at conScaleTest.main(conScaleTest.java:91)

      ----------------------------------

      java.net.SocketException: Bad file number
              at sun.nio.ch.SocketChannelImpl.connect0(Native Method)
              at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:182)
              at conScaleTest.<init>(conScaleTest.java:36)
              at conScaleTest.main(conScaleTest.java:100)

      ---------------------------------

      java.io.IOException: Bad file number
              at sun.nio.ch.FileDispatcher.close0(Native Method)
              at sun.nio.ch.SocketDispatcher.close(SocketDispatcher.java:39)
              at sun.nio.ch.SocketChannelImpl.implCloseSelectableChannel(SocketChannelImpl.java:228)
              at java.nio.spi.AbstractSelectableChannel.implCloseChannel(AbstractSelectableChannel.java:170)
              at java.nio.spi.AbstractChannel.close(AbstractChannel.java:96)
              at conScaleTest.<init>(conScaleTest.java:64)
              at conScaleTest.main(conScaleTest.java:100)



      Windows
      --------
      Windows failures are slightly different. The test (and java bits)
      executed from a networked share doesn't fail as early as on Solaris.
      The first few executions fail ~1400th iteration:

      read failed
      java.io.IOException: Socket close failed
              at sun.nio.ch.SocketDispatcher.close0(Native Method)
              at sun.nio.ch.SocketDispatcher.close(SocketDispatcher.java:44)
              at sun.nio.ch.SocketChannelImpl.implCloseSelectableChannel(SocketChannel
      Impl.java:228)
              at java.nio.spi.AbstractSelectableChannel.implCloseChannel(AbstractSelec
      tableChannel.java:170)
              at java.nio.spi.AbstractChannel.close(AbstractChannel.java:96)
              at conScaleTest.write(conScaleTest.java:84)
              at conScaleTest.<init>(conScaleTest.java:30)
              at conScaleTest.main(conScaleTest.java:91)


      Thereafter subsequent executions fail very early, ~250 with
      the following exception:

      java.net.SocketException: No such file or directory
              at sun.nio.ch.SocketChannelImpl.connect0(Native Method)
              at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:182)
              at conScaleTest.<init>(conScaleTest.java:27)
              at conScaleTest.main(conScaleTest.java:91)


      Infrequently, subsequent executions threw a ConnectException: Too many
      open files.

      Test file attached.

      krystyna.polomski@Eng 2001-04-19
      The bad file numbers are gone in b61. Too many open files can be remedied
      by closing the RSelector in the test (see conScaleTest2.java attached with
      this version), however the reliability of this test particularly on windows is still poor.

      Closing the selector, on solaris we get 1976 successful connects out of
      2000. The remaining failures come from ClosedChannelExceptions.

      Closing the selector, on windows only 9 successful connects out of 2000.
      The remaining failures are ClosedChannelExceptions. What is the cause of
      these ClosedChannelExceptions?

      The original test on b61 (w/out closing the selector) still produces
      a java.net.SocketException: too many open files on Solaris. Can a
      better exception message be sent? On windows, the original test
      behaves as the one with the closed selector, 13 succcessful connects
      out of 2000.


      krystyna.polomski@Eng 2001-05-23
      closing this as verified build65--new connect bugs
      ahve been filed to coverconnect issues. see 4462481.

            mmcclosksunw Michael Mccloskey (Inactive)
            kpolomsksunw Krystyna Polomski (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: