JDK-8005290 : TEST_BUG: remove -showversion from RMI test library subprocess mechanism
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.rmi
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2012-12-20
  • Updated: 2013-12-17
  • Resolved: 2012-12-21
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 7 JDK 8
7u21Fixed 8 b71Fixed
Related Reports
Relates :  
Description
The RMI test library (jdk/test/java/rmi/testlibrary) has a convenience API (the JavaVM class) for launching a JVM subprocess. When starting the subprocess, it adds the -showversion option to the JVM command line and waits for the version output to arrive from the subprocess before returning to the caller. This mechanism was added because the original code unconditionally slept for two seconds before returning to the caller, in an attempt to delay the caller until the JVM subprocess was ready. The -showversion mechanism reduced the wait time if the JVM subprocess became ready sooner.

It turns out this is no longer necessary.

The two-second delay was insufficient to avoid race conditions. Callers that need to interact with the JVM subprocess have to have their own wait/retry logic anyway. Indeed, this is elsewhere in the RMI test library already (RMID.java, ActivationLibrary.java), and in fact all the RMI tests pass with the two-second sleep and showversion mechanism removed, even if an extra delay is added to the subprocess.

Thus the two-second delay and the -showversion mechanism can be removed entirely.

Comments
The initial developer of the showversion mechanism, olagneau, pointed out that the original code waited for the child JVM unconditionally for two seconds. The showversion mechanism was an optimization so that the test didn't have to wait the full two seconds if the child JVM came up faster. But the tests still seem to work even without the two-second delay, so the showversion mechanism isn't necessary either.
20-12-2012