On Tue, 24 Nov 2026 11:16:36 GMT, Alan Bateman <[email protected]> wrote:

>> This is an update to the thread dump generated by 
>> HotSportDiagnosticMXBean.dumpThreads and the jcmd equivalent.
>> 
>> 1. The thread output is updated to include the identity string of the Thread 
>> object to make it easier link a Thread.join usage to the target thread.
>> 2. The parkBlocker is now set when parked in StructuredTaskScope.join parks 
>> to make it easier to find the STS in the thread dump.
>> 3. The thread CPU time is now included for platform threads when available.
>> 4. The JSON dump escapes forward slash between the module and class name in 
>> the stack traces. Escaping of this character is optional and dropped, as it 
>> was annoying.
>> 5. The escaping fails if a thread name contains a control character.
>> 
>> Testing: tier1-3
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Alan Bateman has updated the pull request with a new target base due to a 
> merge or a rebase. The incremental webrev excludes the unrelated changes 
> brought in by the merge/rebase. The pull request contains 14 additional 
> commits since the last revision:
> 
>  - Address review comments
>  - Merge branch 'master' into JDK-8394915
>  - Merge branch 'master' into JDK-8394915
>  - Merge branch 'master' into JDK-8394915
>  - Merge branch 'master' into JDK-8394915
>  - Escape thread name in plain thread dump
>  - cpuTime cleanup
>  - Merge branch 'master' into JDK-8394915
>  - Merge branch 'master' into JDK-8394915
>  - Add cpuTime
>  - ... and 4 more: https://git.openjdk.org/jdk/compare/aa864d9d...f2014652

I've posted a couple of questions on the test update. I do not see any issues 
otherwise.

Marked as reviewed by sspitsyn (Reviewer).

test/jdk/com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java line 681:

> 679:             try (var scope = StructuredTaskScope.open()) {
> 680:                 queue.put(scope);
> 681:                 scope.fork(() -> LockSupport.park());

Q: Is it reliable enough to use `LockSupport.park()` at 681? Can it return 
spuriously? Same applies to the line 765.

test/jdk/com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java line 687:

> 685:             } catch (Throwable e) {
> 686:                 fail(e);
> 687:             }

Q: Are the exception thrown at lines 633 and 686 propagated to the JUnit test 
thread?

test/jdk/com/sun/management/HotSpotDiagnosticMXBean/DumpThreads.java line 695:

> 693:         try {
> 694:             String scopeId = Objects.toIdentityString(scope);
> 695: 

Q: Would it better to move lines 690-691 to the beginning of the try block 
(staring at line 693)?
     Then the finally block at lines 710-713 would handle failures and 
interruptions.

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

PR Review: https://git.openjdk.org/jdk/pull/33659#pullrequestreview-6057884999
PR Review: https://git.openjdk.org/jdk/pull/33659#pullrequestreview-6058115084
PR Review Comment: https://git.openjdk.org/jdk/pull/33659#discussion_r4695105345
PR Review Comment: https://git.openjdk.org/jdk/pull/33659#discussion_r4695174910
PR Review Comment: https://git.openjdk.org/jdk/pull/33659#discussion_r4695260395

Reply via email to