Skip to content

fix: make thread dumps actually contain the process you want - #649

Merged
oyvindberg merged 1 commit into
masterfrom
fix/thread-dump-diagnostics
Aug 9, 2026
Merged

fix: make thread dumps actually contain the process you want#649
oyvindberg merged 1 commit into
masterfrom
fix/thread-dump-diagnostics

Conversation

@oyvindberg

Copy link
Copy Markdown
Owner

Split out of #647, which is now the --max-time feature alone. This half stands on its own and fixes live bugs.

ChildProcessDiagnostics backs two features that already exist — Ctrl-T (SIGINFO) in the client, and the dump the compile server writes at shutdown. Three separate bugs meant both could produce a dump that looked fine and was missing the point. All three are silent: an incomplete dump is indistinguishable from a dump of a healthy process.

bug effect
findJstack only tried bin/jstack, never jstack.exe found nothing on Windows at all — including in the server, the platform and process whose hangs are worth reading
it looked only under java.home the client is a GraalVM native image with no JDK of its own, so it could never dump a child process anywhere
dumpAll walked only descendants() a shared compile server is nobody's descendant — so the dump reliably omitted the one process doing the work

Callers now pass JVM bin directories (they know a real JVM) and extra pids. Child JVM in the output became Other JVM, since the processes that matter most are not children.

Tested, because "silent" is the theme

The extraPids case asserts against a process that is an ancestor of the test JVM — never a descendant, which is exactly the property under test — and I confirmed it fails before the fix rather than assuming it covers anything. (It also asserts the dump contains real frames, not just a header, and that self is never dumped twice.)

Also

  • regenerates the CLI docs, stale for max-cached-workspaces since an earlier merge
  • records that the Windows test step has roughly halved — 13 consecutive re-runs measured 5m11s–7m8s against a comment claiming 12m52s–13m14s, so nobody tightens those bounds against stale numbers

🤖 Generated with Claude Code

`ChildProcessDiagnostics` backs two existing features — Ctrl-T (SIGINFO) in the
client and the dump the compile server writes at shutdown — and three separate
bugs meant both could produce a dump that looked fine and was missing the point.
All three are silent: an incomplete dump is indistinguishable from a dump of a
healthy process.

  - `findJstack` only ever tried `bin/jstack`, never `jstack.exe`, so it found
    nothing on WINDOWS at all — including in the server, which is the platform
    and the process whose hangs are worth reading.

  - it looked only under `java.home`. The client is a GraalVM native image with
    no JDK of its own, so the property is absent or points somewhere without a
    `bin/jstack`, and the client could never dump a child process anywhere. It
    now takes JVM bin directories from the caller, which knows a real one.

  - `dumpAll` walked only `ProcessHandle.current().descendants()`. A shared
    compile server was spawned by whichever client started it, possibly days
    ago, so it is nobody's descendant — meaning the dump reliably omitted the
    one process actually doing the work. Callers can now name extra pids.

`Child JVM` in the output was renamed to `Other JVM`, since the processes that
matter most are not children.

Tested, because "silent" is the theme: the extraPids case asserts against a real
process that is an ANCESTOR of this JVM — never a descendant, which is the
property under test — and it was confirmed to fail before the fix rather than
assumed to cover it.

Also regenerates the CLI docs, stale for `max-cached-workspaces` since an earlier
merge, and records that the Windows test step has roughly halved (13 consecutive
re-runs measured 5m11s-7m8s against a comment claiming 12m52s-13m14s) so nobody
tightens those bounds against stale numbers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@oyvindberg
oyvindberg force-pushed the fix/thread-dump-diagnostics branch from c765557 to 633f1bc Compare August 9, 2026 21:03
@oyvindberg
oyvindberg merged commit eb8ed0a into master Aug 9, 2026
10 checks passed
@oyvindberg
oyvindberg deleted the fix/thread-dump-diagnostics branch August 9, 2026 21:28
oyvindberg added a commit that referenced this pull request Aug 24, 2026
`ChildProcessDiagnostics` backs two existing features — Ctrl-T (SIGINFO) in the
client and the dump the compile server writes at shutdown — and three separate
bugs meant both could produce a dump that looked fine and was missing the point.
All three are silent: an incomplete dump is indistinguishable from a dump of a
healthy process.

  - `findJstack` only ever tried `bin/jstack`, never `jstack.exe`, so it found
    nothing on WINDOWS at all — including in the server, which is the platform
    and the process whose hangs are worth reading.

  - it looked only under `java.home`. The client is a GraalVM native image with
    no JDK of its own, so the property is absent or points somewhere without a
    `bin/jstack`, and the client could never dump a child process anywhere. It
    now takes JVM bin directories from the caller, which knows a real one.

  - `dumpAll` walked only `ProcessHandle.current().descendants()`. A shared
    compile server was spawned by whichever client started it, possibly days
    ago, so it is nobody's descendant — meaning the dump reliably omitted the
    one process actually doing the work. Callers can now name extra pids.

`Child JVM` in the output was renamed to `Other JVM`, since the processes that
matter most are not children.

Tested, because "silent" is the theme: the extraPids case asserts against a real
process that is an ANCESTOR of this JVM — never a descendant, which is the
property under test — and it was confirmed to fail before the fix rather than
assumed to cover it.

Also regenerates the CLI docs, stale for `max-cached-workspaces` since an earlier
merge, and records that the Windows test step has roughly halved (13 consecutive
re-runs measured 5m11s-7m8s against a comment claiming 12m52s-13m14s) so nobody
tightens those bounds against stale numbers.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant