mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4973] [GUI] loaded native instance stops itself while idle; host then reports status:"ready" + phase:"unavailable" forever #2288
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#2288
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 @ambrato on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4973
Area
[GUI] (the desktop app)
Desktop app, Terminal or source?
Desktop app
Reproduction status
Reproduced locally — observed 6 times over 2 days on one machine, every occurrence captured by an external 10 s / 1 s flight recorder (see Logs)
Strata version
Strata 0.2.8 (desktop app) · engine/Control 0.1.54
Graphics card, memory and system
Apple M1 Max, 32-core GPU (unified memory) · 64 GB RAM · macOS 26.5.2
Model, size and settings
Qwen3.8-Flash-Next Q2_0 · 204800 context · pictures on (
--vision --mmap-experts --spec 2 --mtp --expert-cache 64 --pool-workers 8 --vram-reserve-mib 2560)What happened
Two things, and the second is the reason this is confusing to live with.
A. The loaded native instance stops itself while idle — as a clean, externally-ordered stop
I load the model, run a task, then leave Strata idle (app stays open, nothing unloaded by me). After a while — 2.5 h, 3.5 h, 3 h, 2.6 h and 7.5 h on different days, and once at 05:32 while I was asleep — the whole instance is gone: owner host,
serve.serverwrapper, engine andstrata-visionall terminate together.The wrapper's own log (
~/.local/state/strata/runtime/app-1.server.log) ends the same way every time:So this is the
request_stop()→ drain → exit path, not a crash:.ipscrash report for any process in the chain, ever;[strata] stopped, and the wrapper then exits with the engine's QUIT already sent;vm_statevery 10 s and streamed kernelmemorystatus/jetsam telemetry continuously: 11.3–14.4 GB free at each death, zero kill events. So it is not the OOM killer and not pressure.It happens with idle auto-unload disabled:
beginner.gpuIdle = "never"in the app state, andidle_unload_sunset (serve/server.py:9142→svc.idle_unload_s = 0). Had idle unload run, the wrapper would have printedthe model unloads after N s without requestsand only the model would have gone — here the wrapper itself exits.What makes this hard to notice as "unloaded": the loss is discovered only by failing inference requests, and see B.
B. After the instance dies, the published state is permanently wrong and silent
GET /api/nativekeeps reporting the dead instance as ready:~/.local/state/strata/runtime/app-1.host.logis a 0-byte file for the entire life of the app, spanning 6 of these deaths and their reloads.Confirmed independent of my config: if I ask the host to unload and load the same model again, it registers the new instance cleanly and serves normally — so the state/supervision gap in B is not caused by the stop in A.
Smallest steps or command that reproduce it
gpuIdle: "never", idle unload unset.Expected: the instance either keeps serving, or — if some policy decided to release the GPU — the app says so and can serve the next request again.
Actual: the instance is gracefully gone, and the app still reports it as
status:"ready".I could not make it happen faster on demand: there is no minute-scale timer I can point at. What I can report as fact is that every death was preceded within seconds by the small request shown above (
prompt 53 tokens = 0 reused + 53 read, 1 generated, ending in "the reply reached max tokens while still thinking, so it has no answer").Ruled out on my side (each check stated so it can be repeated)
vm_statat 10 s resolution shows 11.3–14.4 GB free at the moment of every death; continuouslog streamonmemorystatus/jetsam/per-process-limitrecorded no kill for this process; no.ipsfiles.gpuIdle: "never",idle_unload_sunset → 0; the wrapper's own "unloads after N s" line never appears in its log; the wrapper itself dies, not only the model.pmset -g logshows only display sleep well before the window, system uptime continuous.--die-with-pid— the node host never restarted across all 6 deaths (same pid and start time), and I verified live thatprocs.start_token(die_with_pid)still equals the--die-with-tokenthe owner host was launched with.runtime stopwas involved in the idle deaths — I sampled the process table once per second for 6 days. The CLI form is catchable and was caught exactly once: the deliberate unload I triggered through the host API (strata.py runtime stop --profile app-1 --wait 120 --output json, 2026-10-31 17:16:33). The 5 unattended deaths have no such record.Go-http-client/1.1); its own logs show zero forwarded requests inside the death windows. Nothing else on the machine references Strata.stopped, and the exit is preceded by the drain path.Code paths that could produce exactly this signature (from reading the shipped 0.2.8 source; I did not observe them executing)
The signature is "wrapper takes the SIGTERM/
request_stoppath, and its parent owner host is gone in the same 10 s window". Two places in the runtime supervisor can do that without leaving any log line I can find:strata_control/runtime.py:1300in the serve loop —if self.probe_result is not None and "error" in self.probe_result and self.child … : self._stop_child(). Anything that writes an error intoprobe_resultafter the instance is up would SIGTERM a healthy engine.runtime.py:908–972,1197–1210,readiness.py, includingprobe_instance_mismatch/probe_invalid_ready_file/probe_internal_error) — note the small 53-token/1-token request that precedes every death, which matches a readiness-style probe, and its "reply reached max tokens while still thinking" outcome for a thinking model withmax_tokens=1.runtime.py:1001_close_owner_pipe()on the host's own exit, whichserve/owner_guard.pyturns intokillpg(SIGTERM)(then SIGKILL after grace) for the wrapper and engine — no command line, no log.For symptom B, the state record is published independently of child liveness; #4250 ("record child absence before publishing managed host state") looks adjacent, though that one covers a host killed before launch rather than a child lost after
ready.Logs
Attached:
issue-evidence.txt— death timeline with watermarks, the wrapper log tail for each of the 6 deaths, the process chain snapshot at death, the per-second CLI capture, a raw sample series across one overnight death, and the setting values. Paths and ids are scrubbed; no keys included.Extra context that might help
An external watchdog currently recovers automatically: on death it calls the app's own API (
POST /api/native/instances/<id>/unload, thenPOST /api/native/operations {"kind":"load",…}) and the model is serving again in ~25 s with the UI consistent. That workaround is also evidence for B being a state/liveness gap rather than a load problem — the host re-registers a fresh instance without complaint as soon as something else notices the old one died.If it narrows anything down: the deaths are spread over idle durations from 2.5 h to 7.5 h and are not tied to sleep, display state, or my activity; and every one of them follows that small internal request. I can run a targeted experiment (e.g. disable whatever issues that probe, or add the stop reason to the wrapper's log) if you tell me which knob to turn.
Attached evidence (flight-recorder output, scrubbed)
(Also available as files: death forensics blocks, per-second process captures, 10-second vm_stat series, pmset power log. Happy to paste more of any section.)
@github-actions[bot] commented on GitHub (Nov 2, 2026):
Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:
Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment
/reopen.Details: CONTRIBUTING.md
@github-actions[bot] commented on GitHub (Nov 2, 2026):
Thanks, this follows the format now.
@ambrato commented on GitHub (Nov 4, 2026):
Update — fine-grained differential probe: the death always starts at the owner host, never at the wrapper
9 more idle self-stops since filing (16 total; including two between 01:30 and 03:10 overnight, nobody present). I upgraded the recorder to sample the two supervisor levels separately at 0.5 s granularity, purely to answer one question: does the stop order reach the wrapper directly (RPC/CLI stop), or does the wrapper only die as a side effect of its parent owner host exiting?
Verdict so far — unanimous, all 9 deaths:
The opposite signature — "wrapper died, owner host still alive", which an ordinary
runtime stopshould produce — has been observed zero times in 9 deaths. The order is always: the owner host (python3.12 -m strata_control.runtime …) disappears, and the wrapper + engine are gone within the same sub-second window. That is consistent with theowner_guardpipe-EOF →killpg(SIGTERM)channel, and also with the supervisor's own stop-and-exit path completing faster than my sample period. At 0.5 s these two are not yet separable — see the new probe at the end.Further ruled out since filing:
log stream(memorystatus / jetsam / runningboardd, filtered to strata/python) is empty in every death window ±90 s; free memory at death 9.9–14.4 GB, no.ipsanywhere in the chain.--die-with-pidmisfire — the node host pid (99679) keeps the same start time (Oct 31 09:44:39) across all 16 deaths, andprocs.start_tokenfor it still equals the--die-with-tokenthe owner host was launched with.runtime stopin 6 days: the deliberate one I triggered over the host API on Oct 31 17:16.What every death still has in common: seconds before it, the same small internal request at the end of the wrapper's log —
Next probe deployed: a once-per-second snapshot of every process holding the runtime's AF_UNIX socket (
~/.local/state/strata/runtime/<hash>.sock) besides the owner host itself. If the next death catches a connecting process, that process is the caller ordering the stop; if deaths keep happening with zero socket clients, the owner host is exiting on its own decision and the search space collapses toruntime.py's own exit paths around the serve loop. I will post whichever way it lands.If there is a knob you want tested here — something that disables the readiness probe, or a debug build that logs the owner host's stop reason / exit status — I'm glad to run the experiment and report exact numbers.
@Niko1221 commented on GitHub (Nov 5, 2026):
Hello ambrato,
Thank you for the long log. We found two causes and fixed both in Strata 0.2.11. On macOS without psutil the runtime owner followed the app host through a
pscall with a 5-second limit, and any failed look was read as "app gone", so it stopped the engine cleanly and silently. A changed start time still ends it at once, but a failed look now needs three in a row and a failed liveness check, and it writes a line inhost.log. The app also stays at ready/unavailable forever: after three failed polls it now asks Control and marks the instance stopped if Control says so. In a 20-minute idle test the instance stayed ready every time. If it still stops itself on 0.2.11, please sendhost.log.The Strata project