pyspy-scheduler.sh: the LFM2.5 and Inkling lanes too, as their probe and their autoheal

The stacks of a wedged SGLang engine were looked for in the 27B and flash containers alone: on the two other SGLang lanes
the evidence was "no serving container running". The wrapper, the probe and the lane registry are held to one list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Hasan BasbunarandClaude Opus 5.5 committed 2026-11-30 08:58:57 +01:00
1 parent 8db0dc786b
commit 4a42092cfe
2 files changed
+27 -3

No files matched your search

+1 -1
View File
@@ -12,7 +12,7 @@ done
# What went wrong goes to stderr, and only a dump to stdout: the cockpit saved this line as
# "scheduler stacks" when it came on stdout (found in review, 2026-09-24).
[ -n "$PYSPY" ] || { echo "py-spy not installed (pip install py-spy, or copy the binary to /usr/local/bin/py-spy)" >&2; exit 3; }
for cont in qwen38-flash qwen38-sglang; do
for cont in qwen38-flash qwen38-sglang qwen38-lfm25 qwen38-inkling; do
pid="$(docker top "$cont" -o pid,comm 2>/dev/null | awk '/schedul/{print $1}' | head -1 || true)"
if [ -n "$pid" ]; then
echo "== $cont scheduler pid $pid, state $(awk '{print $3}' /proc/$pid/stat 2>/dev/null || echo ?) =="
+26 -2
View File
@@ -6,19 +6,25 @@ running") on stdout, and the cockpit took any text back, stderr merged in, for a
the complaint was saved as wedge-*.txt under "scheduler stacks saved" (found in review,
2026-09-24). The wrapper runs here from a copy whose py-spy and docker are stubs."""
import pathlib
import re
import subprocess
import sys
import tempfile
import unittest
REPO = pathlib.Path(__file__).resolve().parents[1]
sys.path.insert(0, str(REPO))
import lane_registry # noqa: E402
WRAPPER = (REPO / "dashboard" / "pyspy-scheduler.sh").read_text()
COCKPIT = (REPO / "dashboard" / "cockpit.py").read_text()
def run(pyspy_exists):
def run(pyspy_exists, container=""):
d = pathlib.Path(tempfile.mkdtemp(prefix="pyspy-"))
(d / "bin").mkdir()
(d / "bin" / "docker").write_text("#!/bin/sh\nexit 1\n") # no container answers
# no container answers, or the one that serves, with its scheduler's process (comm is 15 characters)
(d / "bin" / "docker").write_text(f'#!/bin/sh\n[ "$1 $2" = "top {container}" ] || exit 1\nprintf "PID COMMAND\\n1 python3\\n2 sglang::schedul\\n"\n')
(d / "bin" / "docker").chmod(0o755)
fake = d / "py-spy"
if pyspy_exists:
@@ -45,6 +51,24 @@ class TheWrapperKeepsStdoutForTheDump(unittest.TestCase):
self.assertIn("no serving container running", err)
class EverySGLangLanesSchedulerIsDumped(unittest.TestCase):
"""The wrapper named two containers: a wedge of the LFM2.5 or the Inkling lane, which the same probe and the same
autoheal watch, left "no serving container running" for evidence (found in an audit, 2026-11-30)."""
CONTAINERS = {f["unit"][:-len(".service")] for f in lane_registry.LANES.values() if f["engine"] == "sglang"}
def test_each_of_them_is_found(self):
for cont in sorted(self.CONTAINERS):
with self.subTest(container=cont):
rc, out, err = run(True, cont)
self.assertEqual((rc, out.splitlines()[-1:]), (0, ["stacks"]), err)
self.assertIn(f"== {cont} scheduler pid 2", out)
def test_the_wrapper_and_the_cockpits_probe_name_the_same(self):
named = set(re.search(r"^for cont in (.+); do$", WRAPPER, re.M).group(1).split())
probed = set(re.findall(r'"(qwen38-[a-z0-9-]+)"', re.search(r"^SGL_CONTAINERS = \((.+?)\)", COCKPIT, re.M).group(1)))
self.assertEqual((named, probed), (self.CONTAINERS, self.CONTAINERS))
class TheCockpitReadsTheStatus(unittest.TestCase):
def test_a_dump_is_saved_only_on_success(self):
i = COCKPIT.index('"/usr/local/bin/qwen38-pyspy-scheduler"]')