Repository navigation
feat(op): the console stream never drops a frame: a slow subscriber receives every frame, late, and the child never waits - #1176
Merged
Conversation
…le stream never drops a frame
… per subscriber, so a slow one receives every frame and the child never waits (#1131) brokerStream.publish appended to a 256-slot channel and dropped the frame for a full subscriber; a dropped control frame left op.Run waiting until its context ended. Each subscriber now has an unbounded queue of its own, drained into its channel by a goroutine of its own under a lock of its own, so publish returns at once and every frame arrives in seq order. Cancel leaves the stream, discards the queue, closes the channel and waits for the drain. The in-process broker and the double share it; both the console and the events streams take it. The double's drop test becomes the test that a slow subscriber receives everything; the stream gains tests of order, cancel and publish after cancel; the stub gains a chatty command of 20000 lines on each stream that loses nothing.
…ture/1131-console-spool
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.
Summary
Lane 3 of schedule #1127, rescoped on 2026-10-23: the console stream never drops a frame.
pkg/op/broker_stream.go: each subscriber has an unbounded queue of its own, drained into its channel by a goroutine of its own under a lock of its own, sopublishreturns at once however slow a subscriber is, and every frame arrives inseqorder. Before, a subscriber more than 256 frames behind lost frames, and a lost control frame leftop.Runwaiting until its context ended. Cancel leaves the stream, discards the queue, closes the channel and waits for the drain. The in-process broker and the double share it, for the console and the events streams.seqcontiguous, withDelivernever blocking; the stream keeps order across subscribers, discards on cancel, and ignores a publish after cancel; a command writing 20000 lines to each of stdout and stderr loses nothing throughop.Run.docs/plans/task/1131-console-spool.md, iscomplete. The file and the ring for reconnects stay iteration 2's.Test plan
make quality-gate,make lint-allandmake test-racepass on the committed treeResolves #1131.
Written with AI assistance.
Signed-off-by: David Noble [email protected]
Assisted-by: Claude Code
Time
Computed by the algorithm of noblefactor-ops#188 at merge.