mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[GH-ISSUE #4051] Arena load proceeds with 10 GiB MemAvailable for 40 GiB and wedges the whole host (jbd2 + every D-state task) instead of refusing #1750
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#1750
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 @notphotograph-a11y on GitHub (Oct 25, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4051
Summary
On a 60 GiB host with a 40 GiB expert arena, the engine started a new instance while the previous one's memory was still resident (
current 50.3 GiB,available 10.1 GiB), then allocated the full39.97 GiBarena. The kernel went into global reclaim,jbd2blocked on the root filesystem, every disk-touching task went to D state, and the machine had to be power-cycled after ~21 hours.expert_source.cppalready refuses when the cgroup limit is belowneed; whenavailableis belowneedit only warns, and that warning case is exactly what killed this host.Environment
sm_86, CUDA 13.1);serve/server.py+engine/strata+strata-vision--max-context 131072,--spec 4,--expert-cache auto,--vram-reserve-mib 700idle_unload_s: 1000, so the engine unloads when idle and reloads on the next request — this reload is what ran into the still-exiting instancesrc/core/expert_source.cpphas the same two branches (see below), so this is not already fixed in masterTimeline
From outside: ICMP fine (0% loss, 14 ms), TCP handshakes to 22 and 8080 completed, but zero bytes came back on either for 25 s per attempt, repeatedly, for ~21 h. No shell, no HTTP. Only a hard reset recovered it.
The disk is not the cause
nvmeI/O timeout, no controller reset, no media error, noEXT4-fs errorin any boot's journalnvme1n1p2: recovering journalafter the reset is the expected result of the reset itselfjbd2blocked because the journal could not commit while the system was stalled in reclaim — it is a symptom, not the origin.Why I think this is a bug and not a documented limit
src/core/expert_source.cpp(identical at v0.1.45 and v0.2.4.2):with the comment: "Less RAM available than the arena (another program, an engine still exiting) is only a warning - the OS may make room - per the recommend-not-force rule."
On a host whose RAM is only 1.5x the arena, "the OS may make room" is false: it cannot, and the failure mode is not a failed start but a machine that must be power-cycled. The comment even names this exact case ("an engine that is still exiting"). Since the server itself restarts the engine (idle unload → reload, or its own restart path), this is reachable without anyone doing anything unusual.
Suggested fixes
available < needas fatal when the shortfall is larger than what reclaim could plausibly return (e.g.available < need / 2), or wait for the exiting engine with a bounded timeout and retry, then fail.current; using it as a gate would have stopped this start).Workaround applied here (works, but the engine should not need it)
MemorySwapMax=0is the part that matters: with swap available, the kernel thrashes for hours instead of OOM-killing the one process that ran away.@github-actions[bot] commented on GitHub (Oct 25, 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
@Niko1221 commented on GitHub (Oct 29, 2026):
Thank you for the timeline and the cgroup workaround. The server ended the engine of the earlier run but waited only 10 s after the kill; an engine with tens of GB pinned needs longer, so the new engine's memory guard saw
current 50.3 GiBand loaded into it. Fixed on our side; the fix ships in the next update (0.2.8). The server now waits up to 120 s for such an engine to be gone, and the engine waits up to 20 s for the RAM to come back (STRATA_ARENA_RAM_WAIT_S, 0 loads at once).Not changed: with the RAM really missing, the load still goes on after the warning (we recommend, never force). We did not start an engine on a 60 GiB host, so the wedge itself was not reproduced.
@Niko1221 commented on GitHub (Oct 29, 2026):
Fixed in 0.2.8: the server now waits up to 120 s for the old engine to be gone, and the engine waits up to 20 s for the RAM to come back (
STRATA_ARENA_RAM_WAIT_S; 0 loads at once). If the RAM is really missing, the load still goes on after a warning, because we warn rather than refuse. We could not reproduce the full wedge on a 60 GiB host. Runstrata update. Closing; reopen if it wedges again.