From 0b3ee0560d705ce8fece024cafe0a8b8bbdbfd2a Mon Sep 17 00:00:00 2001 From: Cato <41178744+catomean@users.noreply.github.com> Date: Mon, 9 Nov 2026 11:02:01 +0100 Subject: [PATCH] box-stop: end one load by name instead of every load (#455) The box is under memory pressure (swap full), so one wasteful load, such as the UK's limited batches that relist every held year, can be ended without ending the rest. Claude-Session: https://claude.ai/code/session_019MDtmsWmge2YFXGRyA2au4 Co-authored-by: Claude --- .github/workflows/law-text.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/law-text.yml b/.github/workflows/law-text.yml index 080d854c..adf4b4e9 100644 --- a/.github/workflows/law-text.yml +++ b/.github/workflows/law-text.yml @@ -165,7 +165,16 @@ jobs: exit 0 fi if [ "$SOURCE" = "box-stop" ]; then + # Only the loads whose command names the "publisher" input (a source or publisher key such as + # ukleg); "all" ends every one. The input's default names nothing, so a bare run ends nothing. for pid in $(holders); do + if [ "$PUBLISHER" != "all" ]; then + named=0 + for t in $(tree "$pid"); do + tr '\0' ' ' < "/proc/$t/cmdline" 2>/dev/null | grep -q -- "$PUBLISHER" && named=1 + done + [ "$named" = 1 ] || continue + fi echo "ending the tree of pid $pid" for t in $(tree "$pid"); do kill -TERM "$t" 2>/dev/null || true; done done