hive-agent-sock: kill what a subagent run leaves in its cgroup after it ends
This commit is contained in:
parent
566758483d
commit
2689efebcf
1 changed files with 82 additions and 11 deletions
|
|
@ -515,7 +515,9 @@ impl State {
|
|||
|
||||
/// A new cgroup for one run of `name`; `None` without run cgroups, or
|
||||
/// (logged) when creating it failed, and the run then stays in the
|
||||
/// daemon's cgroup.
|
||||
/// daemon's cgroup. Whatever a run left running in it (a tool child that
|
||||
/// left claude's process group, which `interrupt`'s SIGINT never
|
||||
/// reaches) is killed once the run has ended.
|
||||
fn run_cgroup(&self, name: &str) -> Option<RunCgroup> {
|
||||
let cgroups = self.run_cgroups.as_ref()?;
|
||||
let n = self.run_seq.fetch_add(1, Ordering::Relaxed);
|
||||
|
|
@ -523,6 +525,7 @@ impl State {
|
|||
.create(&format!("{name}-{n}"))
|
||||
.inspect_err(|e| tracing::warn!(name, error = %e, "subagent: run cgroup unavailable"))
|
||||
.ok()
|
||||
.map(RunCgroup::killing_leftovers)
|
||||
}
|
||||
|
||||
/// `config` with its program started through the entry wrapper, at
|
||||
|
|
|
|||
Loading…
Reference in a new issue