Watch
0
0
Fork
You've already forked hyperhive
0

bash tasks are the OOM killer's first victims: score 1000, subagent runs 900, MemoryHigh on the bash daemon

This commit is contained in:
maia 2026-11-18 20:27:14 +01:00 • committed by mara
commit 77f33a23d8

View file

@ -46,15 +46,20 @@ check() {
rm -rf "$out"
mkdir -p "$out/normal" "$out/early" "$out/late"
env -i "$dir/unit-generator" "$out/normal" "$out/early" "$out/late"
local dropin=$out/normal/hive-subagent-daemon.service.d/50-memory-high.conf
if [ -z "$want_high" ]; then
got=$(find "$out" -type f)
if [ -n "$got" ]; then fail "unit generator wrote:"$'\n'"$got"; fi
else
got=$(cat "$dropin" 2>&1)
if [ "$got" != "[Service]"$'\n'"MemoryHigh=$want_high" ]; then
fail "unit generator's drop-in:"$'\n'"$got"
fi
# The subagent daemon and the bash daemon each get one, and nothing else is written.
local unit
for unit in hive-subagent-daemon hive-bash-daemon; do
got=$(cat "$out/normal/$unit.service.d/50-memory-high.conf" 2>&1)
if [ "$got" != "[Service]"$'\n'"MemoryHigh=$want_high" ]; then
fail "unit generator's drop-in for $unit:"$'\n'"$got"
fi
done
got=$(find "$out" -type f | wc -l)
if [ "$got" -ne 2 ]; then fail "unit generator wrote $got files, wanted 2"; fi
fi
# The warning goes to stderr with the journal's `<4>` priority prefix, and
@ -62,7 +67,7 @@ check() {
got=$(env -i "$dir/check" 2>&1)
local want_warn=
if [ -n "$want_why" ]; then
want_warn="<4>$cap $want_why: no BUN_JSC_forceRAMSize heap ceiling and no MemoryHigh= on hive-subagent-daemon; the host's MemoryMax= on the container still applies."
want_warn="<4>$cap $want_why: no BUN_JSC_forceRAMSize heap ceiling and no MemoryHigh= on hive-subagent-daemon or hive-bash-daemon; the host's MemoryMax= on the container still applies."
fi
if [ "$got" != "$want_warn" ]; then
fail "boot check printed:"$'\n'"$got"$'\n'"wanted:"$'\n'"$want_warn"