jtreg for its "agentvm" mode, creates a java.net.ServerSocket which currently binds to "any address" and a ephemeral port. It then launches a java process with "com.sun.javatest.regtest.agent.AgentServer" as the main class and passes it the port number on which the ServerSocket is bound to. AgentServer is then expected to communicate back to the jtreg process on that port using a java.net.Socket.
The ServerSocket is (rightly) configured to accept() only one connection, which is from the AgentServer.
Given that the ServerSocket is bound to "any address", any other host on the network can end up doing a socket connect against this ServerSocket. We have seen such intermittent interference from other hosts in our CI environment, where some unexpected connection has been established against this ServerSocket and thus the actual communication between the jtreg process and the AgentServer never happens, thus leading to test failures.
Binding to loopback address will reduce the chances of such interference.
The ServerSocket is (rightly) configured to accept() only one connection, which is from the AgentServer.
Given that the ServerSocket is bound to "any address", any other host on the network can end up doing a socket connect against this ServerSocket. We have seen such intermittent interference from other hosts in our CI environment, where some unexpected connection has been established against this ServerSocket and thus the actual communication between the jtreg process and the AgentServer never happens, thus leading to test failures.
Binding to loopback address will reduce the chances of such interference.
- relates to
-
JDK-8326623 Tests fail with "invalid stream header: 50524920" or encounter unexpected "PRI * HTTP/2.0"
- Closed