Skip to content

Commit e5e49e3

Browse files
committed
Raise default subscribe timeout to 30s and fix timeout log units
1 parent a90b7ee commit e5e49e3

7 files changed

Lines changed: 22 additions & 11 deletions

File tree

examples/psychedelic/Psychedelic.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ int main(int argc, char** argv) {
135135
base_config.include_sap = false;
136136
base_config.paced = false;
137137
base_config.loop = false;
138-
base_config.subscriber_timeout = std::chrono::seconds(3);
139138

140139
EndpointConfig endpoint;
141140
endpoint.transport = TransportKind::kWebTransport;

include/openmoq/publisher/cli_options.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct CliOptions {
3636
bool paced = false;
3737
bool loop = false;
3838
bool dump_plan = false;
39-
std::chrono::seconds subscriber_timeout = std::chrono::seconds(3);
39+
std::chrono::seconds subscriber_timeout = std::chrono::seconds(30);
4040
};
4141

4242
CliOptions parse_cli_options(int argc, char** argv);

include/openmoq/publisher/publisher_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ struct PublisherConfig {
2727
bool split_cmaf_chunks = true;
2828
bool paced = false;
2929
bool loop = false;
30-
std::chrono::seconds subscriber_timeout = std::chrono::seconds(3);
30+
std::chrono::seconds subscriber_timeout = std::chrono::seconds(30);
3131
};
3232

3333
struct PreparedPublish {

include/openmoq/publisher/transport/moqt_session.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MoqtSession {
3535
bool publish_catalog = false,
3636
bool paced = false,
3737
bool loop = false,
38-
std::chrono::seconds subscriber_timeout = std::chrono::seconds(3));
38+
std::chrono::seconds subscriber_timeout = std::chrono::seconds(30));
3939

4040
TransportStatus connect(const EndpointConfig& endpoint, const TlsConfig& tls);
4141
TransportStatus publish(const openmoq::publisher::PublishPlan& plan);
@@ -59,7 +59,7 @@ class MoqtSession {
5959
bool publish_catalog_ = false;
6060
bool paced_ = false;
6161
bool loop_ = false;
62-
std::chrono::seconds subscriber_timeout_ = std::chrono::seconds(3);
62+
std::chrono::seconds subscriber_timeout_ = std::chrono::seconds(30);
6363
std::optional<EndpointConfig> endpoint_;
6464
std::uint64_t control_stream_id_ = 0;
6565
std::uint64_t peer_max_request_id_ = 0;

src/transport/moqt_session.cpp

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1815,7 +1815,13 @@ TransportStatus serve_subscriptions(PublisherTransport& transport,
18151815
}
18161816

18171817
if (!served_any_subscription) {
1818-
std::cerr << "[moqt-session] no downstream SUBSCRIBE before timeout; closing idle publish session" << '\n';
1818+
std::cerr << "[moqt-session] no downstream SUBSCRIBE before timeout; "
1819+
"idle await-subscribe publish closing"
1820+
<< " namespace=" << track_namespace
1821+
<< " draft=" << openmoq::publisher::to_string(draft)
1822+
<< " timeout_s=" << subscriber_timeout.count()
1823+
<< " note=expecting relay/internal subscriber subscription"
1824+
<< '\n';
18191825
pending_control_bytes = std::move(buffer);
18201826
if (!send_namespace_done) {
18211827
return TransportStatus::success();
@@ -2888,7 +2894,13 @@ TransportStatus MoqtSession::publish_live(std::istream& input,
28882894
} else if (read_status.message == "timed out waiting for stream data" ||
28892895
read_status.message == "no queued read for stream") {
28902896
if (active_subscriptions.empty()) {
2891-
std::cerr << "[moqt-session] live: no subscribers before timeout\n";
2897+
std::cerr << "[moqt-session] live: no downstream SUBSCRIBE before timeout; "
2898+
"idle await-subscribe publish exiting"
2899+
<< " namespace=" << track_namespace_
2900+
<< " draft=" << openmoq::publisher::to_string(draft_version)
2901+
<< " timeout_s=" << subscriber_timeout_.count()
2902+
<< " note=expecting relay/internal subscriber subscription"
2903+
<< '\n';
28922904
break;
28932905
}
28942906
} else {

tests/cli_options_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ int main() {
3535

3636
{
3737
const CliOptions options = parse({"openmoq-publisher", "--input", "sample.mp4"});
38-
ok &= expect(options.subscriber_timeout == std::chrono::seconds(3),
39-
"expected default subscriber timeout to remain 3 seconds");
38+
ok &= expect(options.subscriber_timeout == std::chrono::seconds(30),
39+
"expected default subscriber timeout to be 30 seconds");
4040
ok &= expect(options.split_cmaf_chunks, "expected chunk splitting to be enabled by default");
4141
ok &= expect(options.input_source.kind == openmoq::publisher::InputSourceKind::kFile,
4242
"expected file input to remain the default input source kind");

tests/moqt_session_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,9 +763,9 @@ int main() {
763763
ok &= expect(transport.writes[8].bytes == std::vector<std::uint8_t>({0x09, 0x00, 0x09, 0x01, 0x07, 0x69, 0x6e,
764764
0x74, 0x65, 0x72, 0x6f, 0x70}),
765765
"expected draft-14 PUBLISH_NAMESPACE_DONE to contain the configured track namespace");
766-
ok &= expect(std::find(transport.read_timeouts.begin(), transport.read_timeouts.end(), std::chrono::seconds(3)) !=
766+
ok &= expect(std::find(transport.read_timeouts.begin(), transport.read_timeouts.end(), std::chrono::seconds(30)) !=
767767
transport.read_timeouts.end(),
768-
"expected default subscriber wait timeout to be 3 seconds");
768+
"expected default subscriber wait timeout to be 30 seconds");
769769
}
770770

771771
{

0 commit comments

Comments
 (0)