mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4529] [GUI] Stop ends the job but not the program the job started - killTree kills a tree only on Windows #2042
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#2042
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4529
Problem:
apps/host/server/timeskip.mjs:148is namedkillTree, and its two branches are not equivalent.On Windows
/Ttakes the whole tree with it. On Linux and macOS only the direct child - thepython … clithe job spawns at line 305 / line 454, and neither spawn isdetached- is signalled, so anything that program started survives, re-parented to init. The Time Skip job runs the person's revision command as exactly that kind of grandchild.Your own test expects the tree to go on every platform:
apps/host/tests/timeskip-real.test.mjs:119pollsprocess.kill(pid, 0)for 6 s afterstop(id)and assertsthe revision command (a grandchild of the job) was ended too. Measured on this box (Linux, Node 26.12.1, source checkout at commit e29f8c29,npm testin apps/host): that assertion fails, and it is deterministic, not timing -node --test tests/timeskip-real.test.mjsalone gave the same single failure 3 times out of 3 (6 passed, 1 failed each run). The full host suite here: 1,225 tests, 1,118 pass, 2 fail, 105 skipped; this is one of the two.Consequence for a person on Linux or a Mac: pressing Stop leaves the revision program running - it keeps using the CPU, and it can still write where the copies folder was supposed to be left alone (the test's own next assertions,
plan.mdunchanged andhalf-done.mdnever reaching the person's folder, are never reached because the grandchild assertion stops the test first).Expected: Stop ends the job and everything the job started, on every platform - what the function's name and the test's message both say.
Suggested shape: this app already does it right one file over -
apps/host/server/native-control.mjs:203terminates withprocess.kill(-proc.pid, signal)on non-Windows (falling back toproc.kill) and spawns withdetached: process.platform !== 'win32'at lines 332 and 359, so the child is its own process-group leader and the negative pid reaches the group. Doing the same for the two timeskip spawns (detached on non-Windows, then signal -pid) would makekillTreelive up to its name.Reproduction status: measured on this box for Linux (3 of 3 deterministic, with the file run in isolation to rule out suite interference). Windows and macOS NOT tested here - the Windows branch reads as correct by inspection, and the macOS branch shares the
elsepath with Linux, so the same gap is expected there. Nothing in the fork's own code (apps/host carries only the Memory tab files) touches this path; it is upstream's.@Nyarlathoteppppp commented on GitHub (Oct 29, 2026):
I have a fix with a regression test that fails before and passes after; opening a PR shortly.
@Niko1221 commented on GitHub (Nov 5, 2026):
Hello TheHubUser4860938,
Thank you. In Strata 0.2.11 a Time Skip job leads its own process group on Linux and macOS, and Stop (and the timeout of an agent command) sends SIGTERM, then SIGKILL, to the group, as taskkill /T does on Windows. In a real-app test a command with child processes was fully gone 4.5 seconds after Stop. The agent harness's own Stop still signals the agent process only; we left that as it is. If a child process outlives Stop on 0.2.11, please tell us which command started it.
The Strata project