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

Regression: UDP DatagramSocket timeout code broken in JDK1.2FCS-D build.

XMLWordPrintable

    • 1.2fcs
    • sparc
    • solaris_2.6
    • Verified

      UDP DatagramSocket timeout code via the method setSoTimeout() is broken in the
      FCS-D build. All my UDP java.net tests fail because of this bug.

      When I set a timeout value of say 10 seconds for a DatagramSocket via its
      setSoTimeout() method and then I call the DatagramSocket receive() method
      to receive a datagram packet the receive will never timeout. It should
      timeout in 10 seconds if a datagram packet does not arrive. This worked
      in the FCS-C build.

      My tests do not test for timeouts with TCP Socket's. This bug may be here
      as well.

      I have the UDP client/server test program as part of the attachment. When you
      run the UDP client alone it should timeout as follows and issue retrys:

      % java udpClient -d -v -b 4 -m 10 -l 10 -s lobo -c
      VERBOSE: real buffer size is = 4096
      VERBOSE: server name = lobo
      VERBOSE: number of messages = 10
      VERBOSE: data comparison = true
      VERBOSE: random buffer sizes = false
      VERBOSE: loop count is = 10
      DTI_DoneInitializing
      DEBUG: creating datagram socket
      DEBUG: DATAGRAM SOCKET INFO
      DEBUG: --------------------
      DEBUG: getLocalPort() = 52995
      DEBUG: getSoTimeout() = 0
      DEBUG: Dump getLocalAddress()
      DEBUG: INET ADDRESS INFO
      DEBUG: -----------------
      DEBUG: getHostName() = 0.0.0.0
      DEBUG: getAllByName[0] = 0.0.0.0/0.0.0.0
      DEBUG: getByName() = 0.0.0.0/0.0.0.0
      DEBUG: getLocalHost() = lobo/129.148.27.228
      DEBUG: getHostAddress() = 0.0.0.0
      DEBUG: isMulticastAddress() = false
      DEBUG: INET ADDRESS INFO
      DEBUG: -----------------
      DEBUG: getHostName() = lobo
      DEBUG: getAllByName[0] = lobo/129.148.27.228
      DEBUG: getByName() = lobo/129.148.27.228
      DEBUG: getLocalHost() = lobo/129.148.27.228
      DEBUG: getHostAddress() = 129.148.27.228
      DEBUG: isMulticastAddress() = false
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      DEBUG: resending datagram message #0
      DEBUG: wrote datagram message #0
      ERROR: udpServer not responding after 10 resends of datagram message #0
      VERBOSE: completed loop #1
      VERBOSE: ---------------------------
      VERBOSE: Performance Statistics Are:
      VERBOSE: ---------------------------
      VERBOSE: Client Running: JDK 1.1.7 on Solaris 2.x
      VERBOSE: OS Architecture: sparc
      VERBOSE: Java Vendor: Sun Microsystems Inc.
      VERBOSE: Data Comparison was on
      VERBOSE: Number of Messages sent per loop = 10
      VERBOSE: Total Number of Messages sent = 1
      VERBOSE: Total Number of Resends = 10
      VERBOSE: Number of Data Comparison Failures = 0
      VERBOSE: Total Bytes Transfered = 4K
      VERBOSE: Total Bytes Received = 0K
      VERBOSE: Total Time in Milliseconds = 110213
      VERBOSE: Total Time in Seconds = 110
      VERBOSE: Total Time Formatted = 1 mins 50 secs 213 millsecs
      DTI_Error
      DTI_DoneExecuting
      FINALSTATUS:udpClient:EXIT_ERROR:2:Number of ERRORS:1:TEST INCOMPLETE

      Instead the UDP client program simply hangs on the receive() method
      waiting for a packet that will never arrive:

      % java udpClient -d -v -b 4 -m 10 -l 10 -s lobo -c
      VERBOSE: real buffer size is = 4096
      VERBOSE: server name = lobo
      VERBOSE: number of messages = 10
      VERBOSE: data comparison = true
      VERBOSE: random buffer sizes = false
      VERBOSE: loop count is = 10
      DTI_DoneInitializing
      DEBUG: creating datagram socket
      DEBUG: DATAGRAM SOCKET INFO
      DEBUG: --------------------
      DEBUG: getLocalPort() = 52995
      DEBUG: getSoTimeout() = 0
      DEBUG: Dump getLocalAddress()
      DEBUG: INET ADDRESS INFO
      DEBUG: -----------------
      DEBUG: getHostName() = 0.0.0.0
      DEBUG: getAllByName[0] = 0.0.0.0/0.0.0.0
      DEBUG: getByName() = 0.0.0.0/0.0.0.0
      DEBUG: getLocalHost() = lobo/129.148.27.228
      DEBUG: getHostAddress() = 0.0.0.0
      DEBUG: isMulticastAddress() = false
      DEBUG: INET ADDRESS INFO
      DEBUG: -----------------
      DEBUG: getHostName() = lobo
      DEBUG: getAllByName[0] = lobo/129.148.27.228
      DEBUG: getByName() = lobo/129.148.27.228
      DEBUG: getLocalHost() = lobo/129.148.27.228
      DEBUG: getHostAddress() = 129.148.27.228
      DEBUG: isMulticastAddress() = false
      DEBUG: wrote datagram message #0

      The UDP client/server application is in the attachment.

            mmcclosksunw Michael Mccloskey (Inactive)
            aefreche Alan Frechette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: