From 462da5c225678e4d580e5e8745b73945b5318970 Mon Sep 17 00:00:00 2001 From: Daan Meijer Date: Fri, 9 Oct 2026 03:26:20 +0200 Subject: [PATCH] Rebuild: a stopping worker notices it on keep-alive frames too It checked only after a data frame, so a worker waiting for its range's spool (keep-alive frames only) never stopped on SIGTERM. Co-Authored-By: Claude Opus 5.5 --- commands/edge_node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/commands/edge_node.ts b/commands/edge_node.ts index 55ca96f..5c45e0f 100644 --- a/commands/edge_node.ts +++ b/commands/edge_node.ts @@ -148,12 +148,12 @@ export default class EdgeNode extends BaseCommand { // Inflating runs on a thread-pool thread: the next chunk inflates while this one is indexed. let pending: { to: number; text: Promise } | null = null for await (const frame of decodeFrames(await api.stream(range.id))) { + if (this.stopping) break if (isKeepalive(frame)) continue const next = { to: frame.to, text: unzipAsync(frame.data) } next.text.catch(() => {}) if (pending) await handle(pending) pending = next - if (this.stopping) break } if (pending && !this.stopping) await handle(pending) await posting