mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 15:58:53 +00:00
lifeline.popen ties every engine, image encoder, MCP server and sd-cli to the server that started them (kill-on-close job on Windows, PR_SET_PDEATHSIG from one anchor thread on Linux, a pipe watcher elsewhere). Engines and encoders get their own process group so Ctrl+C, a closing terminal and a console Break reach the server only, which stops the engine the clean way (STOP, QUIT, wait 20 s, terminate 5 s, kill). SIGHUP, SIGBREAK and the Windows console close/logoff/shutdown events take Ctrl+C's path; the handlers are installed before the model loads and the browser launch no longer holds the main thread (#1872). The owner guard escalates SIGTERM to SIGKILL after a grace period. strata_control/procs.py records every launch and finds leftovers; the next engine start, runtime start, runtime stop and the new runtime cleanup end them after re-checking identity. runtime start --die-with-pid for app-owned instances. tests/terminal/lifecycle_matrix.py is the close-path matrix.