Repository navigation
feat(core): signal-managed graceful shutdown for pipeTo - #211
Merged
mo4islona merged 1 commit intoNov 6, 2026
Merged
Conversation
mo4islona
force-pushed
the
bb/fix-the-issue-with-pipes-sdk-210-thr_jzswe86xxx
branch
10 times, most recently
from
November 6, 2026 00:58
af3e52f to
7c0e3e6
Compare
Handle SIGTERM and SIGINT by default, stop source reads, and finish pending writes before cleanup. Support a timeout, cleanup callback and opt-out, and distinguish interrupted runs from completed ranges. Share one abort signal among active pipes, forward finality and cancellation explicitly, and keep caller-owned clients open. A deadline limits waiting; the callback runs after draining and resource cleanup settle. Closes #210. Co-Authored-By: Claude Code <noreply@anthropic.com> Co-Authored-By: Codex <codex@openai.com>
mo4islona
force-pushed
the
bb/fix-the-issue-with-pipes-sdk-210-thr_jzswe86xxx
branch
from
November 6, 2026 14:15
7c0e3e6 to
cca4f82
Compare
mo4islona
deleted the
bb/fix-the-issue-with-pipes-sdk-210-thr_jzswe86xxx
branch
November 6, 2026 14:39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Signal-managed graceful shutdown for
pipeToCloses #210.
Summary
pipeTointercepts SIGTERM and SIGINT by default for every target (ADR-24): it cancels only the source side, so an in-flight commit or fork rollback runs on; the batch in flight is committed, the cursor is saved, resources close, and the promise rejects withPipelineStoppedError(E3001) — a stop must not look like a finished rangeshutdown: fn | { timeout, onShutdown } | false— a cleanup callback, a'30s'-style budget (E3002PipelineShutdownTimeoutErroron expiry) and an explicit opt-out; invalid settings reject withShutdownConfigurationError(E0005) before the pipe startsstore.close()docs/graceful-shutdown.md, ADR-24, specs 04/05/08/09/13/14/15, error registry (92 thrown = documented = registered)Coverage
Full-suite v8 coverage on the remote box, base (
origin/main) vs head:125 new tests (1543 → 1668).
Test plan
pipeTopromise, which kept the shared pair registered past the test; it now awaits the run, and the opt-out assertion reads the count in a synchronous window around the call)conformance/shutdown/signals.test.ts(both signals, budgets, double signal),conformance/pubsub/backfill-stop.test.ts(SIGTERM mid-backfill leaves a resumable cursor)node spec/check-spec.mjs— error registry in sync🤖 Generated with Claude Code