Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b3W3uHbHAmM3orhn7b
21 lines
862 B
Plaintext
21 lines
862 B
Plaintext
== 1. waitFor(timeout) returns false; it does NOT stop the process
|
|
waitFor(500ms) = false
|
|
still alive = true
|
|
destroy() then waitFor -> exit code 143 (128 + SIGTERM 15 = 143)
|
|
|
|
== 2. a shell command spawns a child; destroying the shell orphans it
|
|
descendants of the shell: 1 -> [/usr/bin/sleep]
|
|
shell dead, orphan alive = true <- leaked process
|
|
|
|
== 3. kill the tree: snapshot descendants first, then kill all
|
|
shell alive = false, former child alive = false
|
|
|
|
== 4. ProcessRunner with a deadline
|
|
timedOut=true exit=-1 stdout=started elapsed<2s=true
|
|
|
|
== 5. a background grandchild keeps the pipe open: readAllBytes() waits for IT
|
|
sh exited at once, but readAllBytes() took ~4s; got done|late|
|
|
|
|
== 6. ProcessRunner is not held hostage by the same command
|
|
exit=0 stdout=done| returned in under 2s: true (bounded by the 1s reader grace, not by the 4s grandchild)
|