Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rs/moq-ffi/src/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,10 @@ mod supervision_tests {
inner,
driver: completion.clone(),
});
let broadcast = origin.route("retained".into(), hidden()).unwrap().broadcast().unwrap();
// The route owns the broadcast, and it is the only handle that keeps the origin
// running once the producer is gone.
let route = origin.route("retained".into(), hidden()).unwrap();
let broadcast = route.broadcast().unwrap();
// One importer shares a timebase and one doesn't, so both reservation paths carry the driver.
let timebase = MoqMediaTimebase::new(broadcast.clone()).unwrap();
let container = MoqMediaContainerProducer::new(
Expand Down Expand Up @@ -770,6 +773,8 @@ mod supervision_tests {
.unwrap_or_else(|_| unreachable!("test keeps its panic trigger open")) = true;
assert!(matches!(completion.finished().await, Err(MoqError::Task { .. })));
drop(completion);
// The origin's last owner is gone too, so only the importers still hold the failure.
drop(route);
assert!(matches!(container.cut(), Err(MoqError::Task { .. })));
assert!(matches!(independent.write(Vec::new()), Err(MoqError::Task { .. })));
assert!(matches!(container.finish(), Err(MoqError::Task { .. })));
Expand Down
4 changes: 2 additions & 2 deletions rs/moq-net/src/model/origin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2945,8 +2945,8 @@ struct Serving {
///
/// Clones share one route. Dropping the last clone retracts it, and so does closing
/// its broadcast. The broadcast lives on for the subscriptions already on it for as
/// long as another of its producer handles does. It keeps the origin's [`Driver`]
/// running, so a publisher can drop every [`Producer`] and keep serving.
/// long as another of its producer handles does. The route keeps the origin's
/// [`Driver`] running, so a publisher can drop every [`Producer`] and keep serving.
#[derive(Clone)]
#[must_use = "dropping the last clone of a route retracts it"]
pub struct Route {
Expand Down