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

java/net/DatagramSocket/PortUnreachable.java fails with Address already in use (Bind failed)

    XMLWordPrintable

    Details

      Description

      This has been added re-try logic in JDK-8085875. Though it reduced frequency but still cannot totally be avoided without isolated test environment.

      Test output:
      ----------System.out:(2/78)----------
      Attempting to recreate server socket with port: 43750
      Give up after 5 retries
      ----------System.err:(32/2157)----------
      java.net.BindException: Address already in use (Bind failed)
      at java.base/java.net.PlainDatagramSocketImpl.bind0(Native Method)
      at java.base/java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:130)
      at java.base/java.net.DatagramSocket.bind(DatagramSocket.java:394)
      at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:244)
      at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:301)
      at java.base/java.net.DatagramSocket.<init>(DatagramSocket.java:273)
      at PortUnreachable.recreateServerSocket(PortUnreachable.java:70)
      at PortUnreachable.serverSend(PortUnreachable.java:53)
      at PortUnreachable.execute(PortUnreachable.java:111)
      at PortUnreachable.main(PortUnreachable.java:125)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:230)
      at java.base/java.lang.Thread.run(Thread.java:844)
      java.net.SocketTimeoutException: Receive timed out
      at java.base/java.net.PlainDatagramSocketImpl.peekData(Native Method)
      at java.base/java.net.DatagramSocket.receive(DatagramSocket.java:745)
      at PortUnreachable.execute(PortUnreachable.java:116)
      at PortUnreachable.main(PortUnreachable.java:125)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.base/java.lang.reflect.Method.invoke(Method.java:564)
      at com.sun.javatest.regtest.agent.MainActionHelper$SameVMRunnable.run(MainActionHelper.java:230)
      at java.base/java.lang.Thread.run(Thread.java:844)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              chegar Chris Hegarty
              Reporter:
              xiaofeya Xiaofeng Yang
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: