mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #4967] [Engine] serve: warn when systemd-oomd is running, and name it when the engine is ended by signal 9 #5267
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#5267
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?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/4967
Author: @cakescats
Created: 11/2/2026
Status: 🔄 Open
Base:
main← Head:serve-warn-systemd-oomd📝 Commits (1)
97c5341Serve: say when systemd-oomd is running, at the start and when the engine is ended by signal 9📊 Changes
2 files changed (+72 additions, -1 deletions)
View changed files
📝
serve/server.py(+34 -0)📝
serve/test_server.py(+38 -1)📄 Description
Problem and result
systemd-oomd is on by default on Fedora and Ubuntu 22.04+. When memory pressure stays high it ends whole programs with SIGKILL, before the kernel's OOM killer and without a dmesg line. The engine fills most of the RAM with the model, so oomd can end the engine, or the browser and other apps beside it. Strata said nothing about this: the death note on signal 9 sent the user to
dmesg, which shows nothing after an oomd kill.Now:
serve(enginestrata), a running systemd-oomd is said in one[strata] WARNING:line, the same way the RLIMIT_RTTIME note (#3238) is.journalctl -u systemd-oomd) and the fix (close other programs, a smaller model, orsudo systemctl mask --now systemd-oomd), instead of the dmesg hint.Nothing is changed or refused. On Windows, macOS and a Linux without oomd the output is the same as before.
Related discussion
none (a warning only, no change to a default)
Approach
oomd_running()reads/proc/*/comm, with nosystemctlcall, and returns False when/proccannot be read.oomd_note()returns the sentence, or""outside Linux or without oomd. In the death note the RTTIME check stays first; the oomd note comes before the generic RAM hint, only for rc == -9.Validation
Passed:
python3 -m unittest serve.test_serveron Ubuntu 24.04.5 x86_64 (Python 3.12.3, a QEMU VM), branch head: 361 tests, OK.oomd_note()is"".apt install systemd-oomd(user@.service has ManagedOOMMemoryPressure=kill):python3 serve/server.py --engine strataprints the warning as its first line;--engine mockdoes not.subprocess.Popenas the server does. The oomd pressure limit for user@.service was lowered to 10% withsystemctl set-property --runtimeso the kill came in minutes. The journal saysKilled .../strata-fake-engine.scope due to memory pressure ... 16.59% > 10.00% for > 20s, the process returned rc=-9,StrataEngine.death_note()named systemd-oomd and its journal, anddmesghad no "killed process" line.Failed:
serve.test_servererror (AnswerBeforeTheBody socket timeout, two VisionCacheEviction tests). They error the same way without this change; on the Linux VM all pass.Not run:
Limits
🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.