mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #3407] [Engine] serve/lifeline.py: the portable watcher does not end the child when the child's ps state changes (test_lifeline fails 5/5 on Linux) #1379
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#1379
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 @Norhiro on GitHub (Oct 20, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3407
Area
[Engine] (speed, kernels, models, the server and API)
Desktop app, Terminal or source?
Source (START-HERE.bat, setup.sh or a build)
What happened
Expected: with
STRATA_LIFELINE=watcher, killing the server ends its child. Actual: the child keeps running.serve.test_lifeline.Lifeline.test_the_portable_watcher_ends_the_child_when_the_server_is_killedfails on every run on this machine (5 of 5 runs alone, and in the full Python suite):The other five tests in the module pass, including
test_a_child_ends_when_its_server_is_killed(the Linuxpdeathsigpath). So this concerns the portable watcher, which Linux uses only whenSTRATA_LIFELINE=watcheris set. As far as I can tell from the code, macOS uses it by default.From reading
serve/lifeline.py: the start token is"s:" + ps -o lstart=,stat= -p PID, so it includes the process state._start_token()runs right after the child starts, while the child is still running (R). When the watcher's pipe closes,start_of()sees the child sleeping (S). The tokens differ, the watcher assumes the PID was reused, and it does not signal the child. The state change is easy to show:Suggested change (tested here)
Use only the start time for the token and keep the state just to detect a zombie. In both
_WATCHER.start_of()and_start_token():With this change in a copy of the tree,
serve.test_lifelinepassed 6/6 tests on 5 of 5 runs.lstartis in the locale's format (Japanese here). It is still compared with itself, so the locale should not matter.Smallest steps or command that reproduce it
Reproduction status
Reproduced locally
Strata version
Strata 0.2.0-beta · engine 0.1.45.3 (source, commit
3d1fb480).mainon 2026-10-20 still hasps -o lstart=,stat=at lines 103 and 138.Graphics card, memory and system
Not GPU related. 2 × Xeon E5-2630 v2 (Ivy Bridge-EP, AVX without AVX2/FMA), 252 GB DDR3, Fedora 44 (kernel 7.2.5), Python 3.14.7, procps-ng 4.0.6.
@Niko1221 commented on GitHub (Oct 27, 2026):
Thank you. Fixed in 0.2.7: The lifeline identity is the child's start time, the sampler survives a bad source (#3590, #3407). Your name is on the commit.
Release: https://github.com/Niko1221/Strata/releases/tag/v0.2.7