hive-bash-daemon: keep sibling tasks alive when one is OOM-killed
systemd's default OOMPolicy=stop ends the whole unit when the kernel kills any process in it; set continue, as hive-subagent-daemon does. Module-eval case asserts it.
This commit is contained in:
parent
1b061fc9d5
commit
c1672218b1
2 changed files with 12 additions and 0 deletions
|
|
@ -353,6 +353,11 @@ in
|
||||||
# no stdio fallback — same reasoning as `hive-mcp-http` below.
|
# no stdio fallback — same reasoning as `hive-mcp-http` below.
|
||||||
Restart = "always";
|
Restart = "always";
|
||||||
RestartSec = 3;
|
RestartSec = 3;
|
||||||
|
# systemd's default `stop` tears the whole unit down when the kernel
|
||||||
|
# kills *any* process in its cgroup, so one OOM-killed task would
|
||||||
|
# take every running sibling task with it. `continue` scopes the
|
||||||
|
# loss to the process the kernel chose.
|
||||||
|
OOMPolicy = "continue";
|
||||||
User = userName;
|
User = userName;
|
||||||
Group = userName;
|
Group = userName;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,7 @@ let
|
||||||
|
|
||||||
agentUncapped = agent { };
|
agentUncapped = agent { };
|
||||||
|
|
||||||
|
agentBashDaemon = machine: machine.systemd.services.hive-bash-daemon;
|
||||||
agentSubagentDaemon = machine: machine.systemd.services.hive-subagent-daemon;
|
agentSubagentDaemon = machine: machine.systemd.services.hive-subagent-daemon;
|
||||||
cases = [
|
cases = [
|
||||||
{
|
{
|
||||||
|
|
@ -82,6 +83,12 @@ let
|
||||||
name = "one subagent losing the OOM draw does not stop the daemon";
|
name = "one subagent losing the OOM draw does not stop the daemon";
|
||||||
ok = (agentSubagentDaemon agentUncapped).serviceConfig.OOMPolicy == "continue";
|
ok = (agentSubagentDaemon agentUncapped).serviceConfig.OOMPolicy == "continue";
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
# Each bash task is a process in the daemon's cgroup; under `stop` one
|
||||||
|
# OOM-killed task would end every running sibling task.
|
||||||
|
name = "one bash task losing the OOM draw does not stop the daemon";
|
||||||
|
ok = (agentBashDaemon agentUncapped).serviceConfig.OOMPolicy or null == "continue";
|
||||||
|
}
|
||||||
];
|
];
|
||||||
in
|
in
|
||||||
runGroup "agent-memory" cases
|
runGroup "agent-memory" cases
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue