Skip to content

Commit 9d300ee

Browse files
akhilnarangclaude
andcommitted
fix(systemd): use ManagedOOMMemoryPressureLimit=100% for oomd exemption
The previous ManagedOOMPreference=omit directive requires systemd >=250 (Ubuntu 24.04+). The deploy host runs Ubuntu 22.04 / systemd 249, where omit is silently ignored and the alternate mechanism (=auto on the ancestor user@ service) crashes user@<UID>.service with 219/CGROUP on startup. ManagedOOMMemoryPressureLimit=100% on this unit works on 249: when oomd evaluates kill candidates inside the user slice, the worker's own PSI is compared against 100% and never qualifies. The user slice still has its distro-default 50% PSI threshold that triggers oomd; we just opt the worker out of being chosen as the victim. Drop the now-noop ManagedOOMPreference=omit; the host is not slated for upgrade. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2711e4c commit 9d300ee

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

systemd/dumpyarabot-worker.service

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,21 @@ KillSignal=SIGTERM
2121
# so systemd lets an in-flight dump drain on SIGTERM instead of SIGKILLing
2222
# mid-extraction.
2323
TimeoutStopSec=7260
24-
ManagedOOMPreference=omit
24+
# systemd-oomd PSI kill exemption for systemd 249 (Ubuntu 22.04, deployed
25+
# on `dumps`). The user slice's distro default
26+
# (/usr/lib/systemd/system/user@.service.d/10-oomd-user-service-defaults.conf)
27+
# sets ManagedOOMMemoryPressure=kill with a 50% PSI threshold, which causes
28+
# oomd to kill the heaviest child cgroup whenever slice-wide pressure
29+
# exceeds 50% for 20s — the worker, every time, because it's the heaviest.
30+
#
31+
# We raise THIS unit's own pressure-limit to 100% so that when oomd
32+
# evaluates kill candidates, the worker's PSI is compared against 100% and
33+
# never qualifies. Sibling cgroups (bot, redis) keep normal selection
34+
# behaviour but in practice are too small to ever be selected.
35+
#
36+
# OOMPolicy=continue ensures the worker doesn't get marked failed if a
37+
# CHILD process (aria2c, 7zz) gets OOM-killed by the kernel.
38+
ManagedOOMMemoryPressureLimit=100%
2539
OOMPolicy=continue
2640

2741
[Install]

0 commit comments

Comments
 (0)