Repository navigation
Bound JSON-RPC output without reordering notifications and responses - #57
Merged
Merged
Conversation
A stalled stdio reader can otherwise keep Notify inside a worker state lock forever. Serialize notifications, requests and responses through one bounded FIFO, preserve protocol-v2 wire ordering, and terminate the stream on overflow, write failure or its admission-relative deadline. Make production stdio closure interruptible and drain accepted output inside existing shutdown budgets. Add real lock-holder regressions, ordering and terminal-stream tests, inherited-pipe deadline coverage, goroutine leak checks, and a reproducible sizing fixture. Patch-bump every linked service binary from the released versions. Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
The fallback ordering fixture also receives the asynchronous node/set-local-backend RPC after the ownership gate opens. Treating that metadata write as another fallback closed its latch twice on the Linux runner. Restrict the latch to set-port, make its signal idempotent, and echo the selected port instead of assuming one host-specific free port. Signed-off-by: Jared Ping <13906915+JaredP94@users.noreply.github.com>
JaredP94
force-pushed
the
fix/bounded-notifications
branch
from
November 6, 2026 11:23
4cf7acd to
7416157
Compare
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.
Description
A stopped JSON-RPC reader must not hold worker state locks or broker request dispatch indefinitely. Give each codec one bounded, ordered output writer; notifications, requests and responses retain their FIFO order and existing protocol-v2 envelopes. Overflow, write errors and deadlines kill the stream instead of silently dropping events on a live connection. Existing owners retain recovery policy.
The bound is 256 outstanding frames / 16 MiB (including the active frame), with a five-second deadline from admission, including queue time. Notify/Respond wait at most 10 ms for immediate completion, then report acceptance. The reproducible synthetic startup fixture measures 153 frames / 198,511 bytes and approximately 1.5 ms with a healthy reader; measurements and limitations are in
services/shared/jsonrpc/README.md.Scope
Validation
go vet ./...,GOOS=linux go vet ./...,GOOS=windows go vet ./...,go test -race -count=1 -timeout=5m ./..., andgo test -count=1 -timeout=5m ./...passed on macOS arm64 / Go 1.27.3. The initial engine-manager race run exposed an asynchronous diagnostic/synchronous buffer assertion; explicit codec Close/join fixed that test, and the complete final run passed.gofmt -l servicesempty;git diff --cached --checkclean; SPDX checker reports zero missing headers.cd desktop && npm ci --no-audit --no-fund && npm run -s service-contracts:checkpassed;npm run -s licenses:checkalso passed. No shared/symlinked node_modules.4cf7acde: five jobs passed (SPDX, Desktop, Linux Go modules, Linux cross-process, macOS cross-process). The sixth, Go modules (macos-15), never acquired a runner:runner_id: 0, no steps, and GitHub's annotation says “The job was not acquired by Runner of type hosted even after multiple attempts.” GitHub cancelled that job and marked the overall workflow failed; this is not six green jobs. No CI workflow changes or local substitute are claimed as hosted macOS verification.cross-process-ubuntu-latestfrom that final run usinggh run downloadinto a new empty directory, then ranpython3 -I /tmp/pair-review/scripts/noskip.py <dir>/cross-process.jsonl: 122 passed, zero skips.Risk
Checklist