mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #2257] SIGTERM during a running request restarts the engine instead of exiting (two 47 GB loads, OOM kill) #901
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#901
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 @SeriousJul on GitHub (Oct 13, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/2257
What happens
serve/server.pyrun under a supervisor that stops the model by signalling thewhole process group does not exit. The engine children receive SIGTERM with the
group, the request that was running sees its engine die, and the request path
starts a new engine. The server prints
stopped, its port closes, and theengine it just restarted keeps loading 46.84 GiB. The supervisor, seeing the
port gone, starts a second instance. Two 47 GB loads at once on a 60 GiB box:
systemd-oomdkills the unit.Environment
engine/BUILD.json,src 6f298dff754d187f), Linux, CUDAstrata-iq3_s.json: 125B MoE pack,--expert-cache auto,--vision,--max-context 262144,--kv int8cmdwithSetpgidand signals the groupSteps
python serve/server.py --engine strata --config strata-iq3_s.json --port 6307max_tokens: 4000).engine children, the way a process-group stop does.
Actual
The restart comes from
Service.ensure_loaded()(serve/server.py:2356andserve/server.py:2364), which runs after the shutdown has begun. The processsays
stoppedand stops answering, but it is loading the model again, so RAMkeeps falling while the supervisor starts a fresh instance.
Reproduced twice in a row with the steps above, and seen twice more in the
llama-swap journal on 2026-10-13 at 11:44 and 11:52. A SIGTERM while the server
is idle shuts down cleanly in about 2 s, so the request path is what races it.
Expected
Once SIGTERM or Ctrl+C has been received, no request path starts the engine or
the vision encoder again. The process ends and frees the pinned arena.
Suggested fix
Set a "shutting down" flag in the SIGTERM / KeyboardInterrupt path, before
engine.close()sends QUIT, and haveService.ensure_loaded(),StrataEngine.restart()andVision.restart()refuse to start anything once itis set. The in-flight request then ends with the existing
EngineDiederrorinstead of reloading the model. The server's own shutdown is what kills the
engine, so the restart is triggered by the shutdown itself.
Notes
--open's browser launch; this is the request path restarting the engine.which is what my test script does. That is not a fix, and it is the reason the
OOM is easy to miss: the second load looks like the next model starting.