RFR: 8287008: Improve tests for thread dumps in JSON format [v3]
Chris Plummer
cjplummer at openjdk.java.net
Mon May 23 16:58:44 UTC 2022
On Mon, 23 May 2022 07:53:09 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> test/lib/jdk/test/lib/threaddump/ThreadDump.java line 179:
>>
>>> 177: return this;
>>> 178: if (name().startsWith(name + "/"))
>>> 179: return this;
>>
>> It's not clear to me why this is here. What does it mean if the name of the container starts with `<name>/`?
>
> With the exception of the root container, the names have the form "name1/name2" where name1 is the "external name" and name2 identifies the internal thread grouping. The external name is the object identity for thread pools and thread-per-executors created by user code. In time we may expose ways to provide a name.
Ok. That wasn't in the original example dump, but appears to be there now.
>> test/lib/jdk/test/lib/threaddump/ThreadDump.java line 299:
>>
>>> 297:
>>> 298: // add to map if not already encountered
>>> 299: var container = map.computeIfAbsent(name, k -> new ThreadContainer(name));
>>
>> Why might the container already be in `map`?
>
> They aren't topologically sorted so it's possible to encounter a thread container before its parent.
ok
-------------
PR: https://git.openjdk.java.net/jdk/pull/8784
More information about the serviceability-dev
mailing list