From 319eb74a2334a500ed4e866f439b14aa5dd5ba37 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Sun, 22 Nov 2026 10:26:10 +0100 Subject: [PATCH] Give a runner that exits at once a moment to be seen --- src/data/hook-runner-script.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/data/hook-runner-script.ts b/src/data/hook-runner-script.ts index b1529234..d01a982f 100644 --- a/src/data/hook-runner-script.ts +++ b/src/data/hook-runner-script.ts @@ -182,7 +182,15 @@ def start(runner, env, log_max): "version": runner.get("version") or "", }, ) + # A login shell can still be reading its profiles when the first look + # happens, so give a process that exits soon a moment to be seen doing + # it: another 1.2s costs nothing here and keeps a dead runner from + # being reported as running. + deadline = time.time() + 1.2 code = child.poll() + while code is None and time.time() < deadline: + time.sleep(0.1) + code = child.poll() if code is not None: tail = log_tail(runner_id, 400) try: