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

make TestLibrary.createRegistryOnUnusedPort() more robust to BindExceptions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None
    • x86_64
    • os_x

      There are a number of test failures, on macosx, due to BindException in the invocation of
      TestLibrary.createRegistryOnUnusedPort as shown below.
      This is an imtermitent failure, due to a number of possible conditions: a race condition in the port allocation algorithm, and a macosx port allocation bug.

      Nonetheless, this is an issue that can occur and the current TestLibrary.createRegistryOnUnusedPort needs to be adapted to accomodate this possibility and execute a retry in the event of such an exception

      java.net.BindException: Address already in use (Bind failed)
      at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:346)
      at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:254)
      at sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:412)
      at sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
      at sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:237)
      at sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:219)
      at sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:204)
      at java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:203)
      at TestLibrary.createRegistryOnUnusedPort(TestLibrary.java:410)

            msheppar Mark Sheppard
            msheppar Mark Sheppard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: