RFR: 8210558: serviceability/sa/TestJhsdbJstackLock.java fails to find '^\s+- waiting to lock <0x[0-9a-f]+> \(a java\.lang\.Class ...'
Chris Plummer
cjplummer at openjdk.java.net
Fri Dec 3 05:25:31 UTC 2021
The issue appears to be due to running jstack before allowing the 4 threads created by `LingeredAppWithLock` to fully start up and reach their blocking or timed wait state. With this fix `LingeredAppWithLock.main()` now waits until the threads have reached the blocking or timed wait state before calling into `LingeredApp.main()`.
Tests that use `LingeredAppWithLock` call `LingeredApp.startApp()`, which will first launch `LingeredAppWithLock` and then block until the lock file is touched. This blocking/waiting is done the call to `waitAppReady()`, which will be called before `LingeredApp.startApp()` returns. The lock file is not touched until `LingeredApp.main()` is called, and it is not called until after `LingeredAppWithBloc.main()` has already verified the state of all the threads. Thus by the time `LingeredApp.startApp()` returns, we can be sure that the threads started by `LingeredAppWithLock.main()` are in the desired state.
-------------
Commit messages:
- Don't run jstack until after all target process threads are done starting up.
Changes: https://git.openjdk.java.net/jdk/pull/6689/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6689&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8210558
Stats: 14 lines in 1 file changed: 13 ins; 0 del; 1 mod
Patch: https://git.openjdk.java.net/jdk/pull/6689.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6689/head:pull/6689
PR: https://git.openjdk.java.net/jdk/pull/6689
More information about the serviceability-dev
mailing list