JDK-8221303 : sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.java fails due to java.rmi.server.ExportException: Port already in use
  • Type: Bug
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 13
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-03-22
  • Updated: 2024-02-01
  • Resolved: 2019-07-18
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13 JDK 14
13 b31Fixed 14Fixed
Related Reports
Duplicate :  
Relates :  
Description
DEBUG: Running tests with SSL sockets.

DEBUG: Launching java tester for triplet (HOSTNAME,JMX_PORT,RMI_PORT) == (10.133.184.204,9272,9273)
...
DEBUG: Started 1 Process(es).

DEBUG: Launching java tester for triplet (HOSTNAME,JMX_PORT,RMI_PORT) == (127.0.0.1,9272,9273)
...
DEBUG: Started 2 Process(es).
[JMX-Tester-127.0.0.1]:/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/linux-x64-debug.jdk/jdk-13/fastdebug/bin/java -cp /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.d:/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap:/scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/test/lib:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b14/bundles/jtreg_bin-4.2.zip/jtreg/lib/javatest.jar:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b14/bundles/jtreg_bin-4.2.zip/jtreg/lib/jtreg.jar -classpath /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.d -Dcom.sun.management.jmxremote.host=127.0.0.1 -Dcom.sun.management.jmxremote.port=9272 -Dcom.sun.management.jmxremote.rmi.port=9273 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=true -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.registry.ssl=true -Djavax.net.ssl.keyStore=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/keystore -Djavax.net.ssl.trustStore=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/truststore -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=trustword JMXAgentInterfaceBinding 127.0.0.1 9272 9273 true
--- ProcessLog ---
cmd: /scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/linux-x64-debug.jdk/jdk-13/fastdebug/bin/java -cp /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.d:/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap:/scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/test/lib:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b14/bundles/jtreg_bin-4.2.zip/jtreg/lib/javatest.jar:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b14/bundles/jtreg_bin-4.2.zip/jtreg/lib/jtreg.jar -classpath /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.d -Dcom.sun.management.jmxremote.host=127.0.0.1 -Dcom.sun.management.jmxremote.port=9272 -Dcom.sun.management.jmxremote.rmi.port=9273 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=true -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.registry.ssl=true -Djavax.net.ssl.keyStore=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/keystore -Djavax.net.ssl.trustStore=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/truststore -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=trustword JMXAgentInterfaceBinding 127.0.0.1 9272 9273 true
exitvalue: 1
stderr: 
stdout: 

[JMX-Tester-10.133.184.204] DEBUG: Running test for triplet (hostname,jmxPort,rmiPort) = (10.133.184.204,9272,9273), useSSL = true
[JMX-Tester-10.133.184.204] JMXConnectorThread: Attempting JMX connection on: 10.133.184.204 on port 9272
[JMX-Tester-10.133.184.204] JMXConnectorThread: connection to JMX worked
[JMX-Tester-10.133.184.204] JMXConnectorThread: connection to rmi socket worked host/port = 10.133.184.204/9273
[JMX-Tester-10.133.184.204] MainThread: Finished waiting for JMX agent to become available: expired == false
[JMX-Tester-10.133.184.204] MainThread: Ready for connections
DEBUG: Found expected READY_MSG.
[JMX-Tester-10.133.184.204] MainThread: Cooperative Exit
--- ProcessLog ---
cmd: /scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/linux-x64-debug.jdk/jdk-13/fastdebug/bin/java -cp /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.d:/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap:/scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/test/lib:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b14/bundles/jtreg_bin-4.2.zip/jtreg/lib/javatest.jar:/scratch/opt/mach5/mesos/work_dir/jib-master/install/java/re/jtreg/4.2/promoted/all/b14/bundles/jtreg_bin-4.2.zip/jtreg/lib/jtreg.jar -classpath /scratch/opt/mach5/mesos/work_dir/slaves/2dd962d0-8988-479b-a804-57ab764ada59-S1297/frameworks/1735e8a2-a1db-478c-8104-60c8b0af87dd-0196/executors/8e378359-174d-4a57-b7de-73acdf3f17a0/runs/c9bd8830-4a23-4471-a78f-9b64fd5d6a4a/testOutput/test-support/jtreg_open_test_jdk_jdk_management/classes/1/sun/management/jmxremote/bootstrap/JMXInterfaceBindingTest.d -Dcom.sun.management.jmxremote.host=10.133.184.204 -Dcom.sun.management.jmxremote.port=9272 -Dcom.sun.management.jmxremote.rmi.port=9273 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=true -Djava.rmi.server.hostname=10.133.184.204 -Dcom.sun.management.jmxremote.registry.ssl=true -Djavax.net.ssl.keyStore=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/keystore -Djavax.net.ssl.trustStore=/scratch/opt/mach5/mesos/work_dir/jib-master/install/jdk13-jdk.664/src.full/open/test/jdk/sun/management/jmxremote/bootstrap/ssl/truststore -Djavax.net.ssl.keyStorePassword=password -Djavax.net.ssl.trustStorePassword=trustword JMXAgentInterfaceBinding 10.133.184.204 9272 9273 true
exitvalue: 10
stderr: 
stdout: 

DEBUG: OK. Spawned java process terminated with expected exit code of 10
----------System.err:(137/10698)----------
[JMX-Tester-10.133.184.204] DEBUG: MainThread: actualTerm: 'Exit: 10'
java.io.IOException: Stream closed
	at java.base/java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:176)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:342)
	at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107)
	at jdk.test.lib.process.StreamPumper.run(StreamPumper.java:109)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:835)
java.io.IOException: Stream closed
	at java.base/java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:176)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:342)
	at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107)
	at jdk.test.lib.process.StreamPumper.run(StreamPumper.java:109)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:835)
[JMX-Tester-127.0.0.1] DEBUG: MainThread: actualTerm: 'Exit: 10'
java.io.IOException: Stream closed
	at java.base/java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:176)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:342)
	at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107)
	at jdk.test.lib.process.StreamPumper.run(StreamPumper.java:109)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:835)
java.io.IOException: Stream closed
	at java.base/java.io.BufferedInputStream.getBufIfOpen(BufferedInputStream.java:176)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:342)
	at java.base/java.io.BufferedInputStream.fill(BufferedInputStream.java:252)
	at java.base/java.io.BufferedInputStream.read1(BufferedInputStream.java:292)
	at java.base/java.io.BufferedInputStream.read(BufferedInputStream.java:351)
	at java.base/java.io.FilterInputStream.read(FilterInputStream.java:107)
	at jdk.test.lib.process.StreamPumper.run(StreamPumper.java:109)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.lang.Thread.run(Thread.java:835)
PROBLEM: JMX agent of target JVM did not start as it should.
[JMX-Tester-127.0.0.1] Error: JMX connector server communication error: service:jmx:rmi://127.0.0.1:9273
[JMX-Tester-127.0.0.1] jdk.internal.agent.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 9273; nested exception is: 
[JMX-Tester-127.0.0.1] 	java.net.BindException: Address already in use (Bind failed)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:820)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:479)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:599)
[JMX-Tester-127.0.0.1] Caused by: java.rmi.server.ExportException: Port already in use: 9273; nested exception is: 
[JMX-Tester-127.0.0.1] 	java.net.BindException: Address already in use (Bind failed)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:335)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:243)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:411)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.transport.LiveRef.exportObject(LiveRef.java:147)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:233)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap$PermanentExporter.exportObject(ConnectorBootstrap.java:203)
[JMX-Tester-127.0.0.1] 	at java.management.rmi/javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:153)
[JMX-Tester-127.0.0.1] 	at java.management.rmi/javax.management.remote.rmi.RMIJRMPServerImpl.export(RMIJRMPServerImpl.java:138)
[JMX-Tester-127.0.0.1] 	at java.management.rmi/javax.management.remote.rmi.RMIConnectorServer.start(RMIConnectorServer.java:473)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.exportMBeanServer(ConnectorBootstrap.java:816)
[JMX-Tester-127.0.0.1] 	... 3 more
[JMX-Tester-127.0.0.1] Caused by: java.net.BindException: Address already in use (Bind failed)
[JMX-Tester-127.0.0.1] 	at java.base/java.net.PlainSocketImpl.socketBind(Native Method)
[JMX-Tester-127.0.0.1] 	at java.base/java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:440)
[JMX-Tester-127.0.0.1] 	at java.base/java.net.ServerSocket.bind(ServerSocket.java:386)
[JMX-Tester-127.0.0.1] 	at java.base/java.net.ServerSocket.<init>(ServerSocket.java:249)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap$SslServerSocket.<init>(ConnectorBootstrap.java:1009)
[JMX-Tester-127.0.0.1] 	at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap$HostAwareSslSocketFactory.createServerSocket(ConnectorBootstrap.java:935)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.transport.tcp.TCPEndpoint.newServerSocket(TCPEndpoint.java:666)
[JMX-Tester-127.0.0.1] 	at java.rmi/sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:324)
[JMX-Tester-127.0.0.1] 	... 12 more
Comments
URL: https://hg.openjdk.java.net/jdk/jdk13/rev/ec3103bb9f6c User: dtitov Date: 2019-07-18 19:31:34 +0000
18-07-2019

FWIW - I believe we have only two possible fixes: 1. try and implement a retry strategy as suggested here: https://bugs.openjdk.java.net/browse/JDK-8221303?focusedCommentId=14259877&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-14259877 or 2. mark this test as /manual so that it's no longer run automatically.
03-07-2019

Spotted frequently enough to be considered a maintainer-pain.
02-07-2019

One new failure observed on jdk-13-1273 tier3 - linux-x64.
10-06-2019

New failures observed in jdk-13-947 jdk-13-1097 tier3.
22-05-2019

One possibility could be to rework the test to retry in case of failure: if one of the sub process fails to bind, select a new couple of random ports and try again. We could bail out after - say - two or three attempts. We might have to bump up the various timeouts if we decide to implement that though.
26-04-2019

[~sgehwolf] It fails from time to time in the nightly. It's really difficult to know what might have been running concurrently on those machines (I mean there are all infrastructure processes etc...). The job that the machines were running was tier3 - which has a vast collection of tests. The particular task the machine was executing at that time though was jdk/test/jdk/:jdk_management. From jdk/test/jdk/TEST.ROOT we can see that sun/management/jmxremote is in the exclusiveAccess.dirs list - which if I'm not mistaken means that the tests under this directory will be run one by one. But I'm not sure whether that prevents other tests from other dirs from running concurrently with these. As to the various failures we observed: First failure: Loopback, SSL=true, with RMI port = 9273; Second failure: Local host IP, SSL=false, with JMX port = 9179; Third failure: Loopback, SSL=false, with JMX port = 9164; Fourth failure: Local host IP SSL=true, with RMI port = 9299; No particular pattern I can see. Up to now only 4 failures observed since the fix was pushed (unless I missed some). Let's keep that on the radar - and maybe keep a thread on the background of our minds to try and think if we could reduce the intermittent noise.
16-04-2019

Another tweak to capture exceptions during HostAwareSocketFactory.createServerSocket() : diff --git a/src/jdk.management.agent/share/classes/sun/management/jmxremote/ConnectorBootstrap.java b/src/jdk.management.agent/share/classes/sun/management/jmxremote/ConnectorBootstrap.java --- a/src/jdk.management.agent/share/classes/sun/management/jmxremote/ConnectorBootstrap.java +++ b/src/jdk.management.agent/share/classes/sun/management/jmxremote/ConnectorBootstrap.java @@ -894,6 +894,18 @@ return new ServerSocket(port, 0, addr); } catch (UnknownHostException e) { return new ServerSocket(port); + } catch (IOException ioe) { + ProcessHandle.allProcesses() + .forEach(process -> + System.out.println(process.toString()+ + "," + process.info().command()+ + "," + process.info().user())); + try { + Process p = new ProcessBuilder().inheritIO().command("netstat", "-aonp").start(); + } catch (Exception e2) { + } + + throw ioe; } }
10-04-2019

[~gadams] Thanks for looking at this. FYI: The test starts two processes. The order in which those get started shouldn't matter. The test intends to verify that it's possible to bind the remote JMX agent to a specific host:port pair (one process gets to bind to different pairs). That wasn't the case prior JDK-6425769 as it would bind to 0.0.0.0 (all interfaces).
10-04-2019

I've had some luck tracking down jstatd port already in use by dumping process and socket information at the time a bind exception is detected. e.g. diff --git a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java --- a/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java +++ b/src/java.rmi/share/classes/sun/rmi/transport/tcp/TCPTransport.java @@ -332,6 +332,16 @@ "TCP Accept-" + port, true)); t.start(); } catch (java.net.BindException e) { + ProcessHandle.allProcesses() + .forEach(process -> + System.out.println(process.toString()+ + "," + process.info().command()+ + "," + process.info().user())); + try { + Process p = new ProcessBuilder().inheritIO().command("netstat", "-aonp").start(); + } catch (Exception e2) { + } + throw new ExportException("Port already in use: " + port, e); } catch (IOException e) { throw new ExportException("Listen failed on port: " + port, e); No conclusions yet, but it appears when 2 processes are launched, the second processes is being scheduled ahead of the first loopback process. (Not sure if that is relevant to the test or not) Getting a reproducible failure in 1 out 500 testruns.
10-04-2019

OK, thanks.
05-04-2019

[~dfuchs] Trying whether a port is free first before actually binding to it, will likely make matters worse. Is it consistently failing on the RMI port when it does fail? Is it consistently failing when SSL == true? Do you have access to the test machines? Are there lingering processes which didn't get killed?
05-04-2019

Observed to fail again on linux-x64-debug. [~sgehwolf] any idea on what we could do? I was wondering whether checking whether the pair of ports are free in the master process (by e.g. opening and closing a ServerSocket with NO_LINGER before starting the subprocess) would be worth trying... Or maybe it would make things worse - I don't know. There's a jtreg.SkipException we could throw if we can't manage to find a pair of ports after a few attempts.
05-04-2019

Some history: https://bugs.openjdk.java.net/browse/JDK-8219585 http://mail.openjdk.java.net/pipermail/serviceability-dev/2019-February/027188.html https://mail.openjdk.java.net/pipermail/serviceability-dev/2019-March/027323.html
05-04-2019

Failed again on linux-x64-debug - with same exception (Bind failed: address already in use). This time with the host address (not the loopback).
28-03-2019

Due to the nature of the test, it is not possible to make 100% sure that the test will always succeed. The ports are chosen at random - and it is not impossible that one of them would be in use. We should keep an eye on this: this is a question of noise ratio. If this test starts failing too often, in particular during promotions we may have to do something (like marking it as manual with the appropriate jtreg keyword on the @run line).
22-03-2019