Skip to content

feat(op): the console stream never drops a frame: a slow subscriber receives every frame, late, and the child never waits - #1176

Merged
David-Noble-at-work merged 6 commits into
developfrom
feature/1131-console-spool
Oct 25, 2026
Merged

David-Noble-at-work merged 6 commits into
developfrom
feature/1131-console-spool

Conversation

@David-Noble-at-work

@David-Noble-at-work David-Noble-at-work commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

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, so publish returns at once however slow a subscriber is, and every frame arrives in seq order. Before, a subscriber more than 256 frames behind lost frames, and a lost control frame left op.Run waiting 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.
  • Tests: a slow subscriber receives 10001 frames, seq contiguous, with Deliver never 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 through op.Run.
  • 2.7's status companion records it; the plan, docs/plans/task/1131-console-spool.md, is complete. The file and the ring for reconnects stay iteration 2's.

Test plan

  • make quality-gate, make lint-all and make test-race pass on the committed tree

Resolves #1131.

Written with AI assistance.

Signed-off-by: David Noble [email protected]
Assisted-by: Claude Code

Time

Marker UTC Elapsed
opened (first commit) 2026-10-23T20:45:02Z —
submitted (PR opened) 2026-10-25T04:06:29Z 31.4 h after opened
merged 2026-10-25T04:26:48Z 0.3 h after submitted; 31.7 h in all

Computed by the algorithm of noblefactor-ops#188 at merge.

… 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The console stream never drops a frame: a slow subscriber receives every one, late, and the child is never blocked on it

1 participant