Skip to content

1.0.4: wait up to 10 s in init for an idle mirror's first grain - #22

Merged
LeeO86 merged 2 commits into
mainfrom
fix/idle-mirror-wait
Oct 15, 2026
Merged

LeeO86 merged 2 commits into
mainfrom
fix/idle-mirror-wait

Conversation

@LeeO86

@LeeO86 LeeO86 commented Oct 15, 2026

Copy link
Copy Markdown
Owner

Problem

Round 4 on small (d146a4e) passed except on an idle mirror: replication needed more than 1 s for the mirror's first grain. The preroll logged preroll_no_grain_yet after 1000 ms, then channel_bringup_failed with a 500 ms retry, and the output was healthy 0.9 s later.

Change

OutputChannel::bringUp (src/channel/output_channel.cpp) now waits for a flow's first grain in state init, for up to 10 s:

  • It logs preroll_no_grain_yet once at info after 1 s, and preroll_first_grain with waited_ms when the grain arrives.
  • Only when no grain has come after 10 s does the bring-up fail (preroll_no_grain, warning) and retry as before.

The docs are updated: SPECIFICATION §2.4 Preroll and CHANGELOG 1.0.4.

Tests

New unit test: the first grain arrives 2.5 s after the route.

  • The output stays in init and is never failed.
  • No channel_bringup_failed.
  • Healthy within 0.5 s of the grain, with audio in sync.
  • One preroll_no_grain_yet and one preroll_first_grain line.

No merge, no tag, no release.

🤖 Generated with Claude Code

https://claude.ai/code/session_01St7QwmonpoG9EEEqaLFXLi

LeeO86 and others added 2 commits October 15, 2026 23:26
The replication of a mirror without demand can take more than 1 s for its first grain. The preroll now waits up to 10 s in state init (preroll_no_grain_yet once after 1 s, preroll_first_grain when it comes) and fails the bring-up only after that (preroll_no_grain). Test: first grain after 2.5 s, no failed bring-up, healthy within 0.5 s, audio in sync.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01St7QwmonpoG9EEEqaLFXLi
@LeeO86
LeeO86 merged commit d148a47 into main Oct 15, 2026
1 check passed
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.

1 participant