From becd56b42f612b33e15296c744ab5983c1a19fa8 Mon Sep 17 00:00:00 2001 From: "every.channel" Date: Wed, 18 Feb 2026 00:18:45 -0800 Subject: [PATCH] ec-node: drive session during announce --- crates/ec-node/src/main.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/ec-node/src/main.rs b/crates/ec-node/src/main.rs index d226312..060e3d1 100644 --- a/crates/ec-node/src/main.rs +++ b/crates/ec-node/src/main.rs @@ -4259,16 +4259,16 @@ async fn wt_publish(args: WtPublishArgs) -> Result<()> { .await .context("failed to create moq-transport publisher")?; - tracing::info!("announcing track(s)"); - publisher - .announce(reader) - .await - .context("publisher announce failed")?; - - // Run the relay session pump in the background; publishing happens by writing objects to - // the track writer via moq-pub's fMP4 parser. + // Run the relay session pump in the background; announcing and publishing require the + // session driver to be polled. let session_task = tokio::spawn(async move { session.run().await }); + tracing::info!("announcing track(s)"); + match tokio::time::timeout(Duration::from_secs(5), publisher.announce(reader)).await { + Ok(res) => res.context("publisher announce failed")?, + Err(_) => anyhow::bail!("publisher announce timed out"), + } + // Spawn ffmpeg to generate fMP4 suitable for hang/moq-mux. // We keep this conservative and deterministic-ish by default: // - single threaded x264