In this test, 10 JVMs are launched, each with a unique ID argument. The test 
then iterates over all started VM IDs and calls releaseStarted(Integer id) for 
each. In releaseStarted the test iterates over all 10 expected processes, and 
for every candidate process hasMainArgs(...) retries up to 10 times to read the 
main arguments. If the arguments are reported as "Unknown" it sleeps one second.

In the worst case, this can add up to about 100 seconds of waiting for a single 
found VM ID when an unrelated process has inaccessible main arguments, which we 
have seen on one of our test machines.

I suggest reading the main arguments only once per VM ID, then comparing that 
single result against the 10 expected unique IDs.

-------------

Commit messages:
 - Update MonitorVmStartTerminate.java

Changes: https://git.openjdk.org/jdk/pull/30423/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30423&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8380896
  Stats: 24 lines in 1 file changed: 10 ins; 2 del; 12 mod
  Patch: https://git.openjdk.org/jdk/pull/30423.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/30423/head:pull/30423

PR: https://git.openjdk.org/jdk/pull/30423

Reply via email to