Fix process-tree termination for background kills#388
Fix process-tree termination for background kills#388kchro3 wants to merge 8 commits intocloudflare:mainfrom
Conversation
🦋 Changeset detectedLatest commit: a8a5a70 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
/bonk review this PR |
Review of PR #388: Fix process-tree termination for background killsGood problem to solve — orphaned child processes after Bug:
|
|
Review complete. I posted:
|
|
/bonk review this PR |
whoiskatrin
left a comment
There was a problem hiding this comment.
Nice fix overall — process-group-first termination + fallback traversal and the new regression coverage are both solid.
A few nits:
-
package-lock.jsonseems unrelated in this PR (only"peer": truemarkers in platform entries). Can we drop it unless it was intentional? -
In
Session.destroy(), we now callkillCommand(commandId, false). WithwaitForExit=false, we sendSIGTERMand immediately remove tracking. If a process ignores TERM, this may leave survivors during destroy. Could we still do a best-effort escalation toSIGKILLin the non-wait path (or keep wait enabled in destroy)? -
In the new E2E test, can we assert the response for
/api/file/writesetup call (expect(status).toBe(200)) so setup failures are explicit?
Not blocking, but would be great to tighten these up.
|
@whoiskatrin , ok, is there a good way to do end-to-end testing? e.g. deploying the docker image to staging tag? |
|
cc: @whoiskatrin , let me know how to proceed |
Summary
Session.killCommand.Motivation
Reports in #338 showed
killProcess()returning success while descendant processes continued running.We're trying to run claude in the sandbox with execStream, but we're finding that it gets into a bad state where exiting the execStream doesn't kill the claude process correctly.
Testing
tests/e2e/process-lifecycle-workflow.test.ts.