From 57d98f41684292b19242012914fa394d3e956dfe Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Wed, 23 Sep 2026 14:45:58 +0800 Subject: [PATCH 1/2] fix(config): set connect/timeout_ms and connect/exit_on_failure Both keys were unset, so a peer session used the Zenoh crate's own connect defaults instead of the values rmw_zenoh_cpp documents in DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5. With no router reachable, the crate default's behavior (retry duration, whether it blocks session start) was never checked against rmw_zenoh_cpp's own: a failed peer connect does not stop or block the session, only a client's does. --- crates/hiroz/src/config.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/crates/hiroz/src/config.rs b/crates/hiroz/src/config.rs index b6cf922f2..74647b87d 100644 --- a/crates/hiroz/src/config.rs +++ b/crates/hiroz/src/config.rs @@ -7,7 +7,7 @@ //! # Architecture //! - Common overrides: 10 settings shared between router and session //! - Router-specific: 5 settings unique to router mode -//! - Session-specific: 6 settings unique to peer mode +//! - Session-specific: 8 settings unique to peer mode //! //! # Example //! ```no_run @@ -230,7 +230,7 @@ fn router_specific_overrides() -> &'static [ConfigOverride] { &ROUTER_SPECIFIC } -/// Session-specific overrides (6 settings) +/// Session-specific overrides (8 settings) fn session_specific_overrides() -> &'static [ConfigOverride] { static SESSION_SPECIFIC: LazyLock> = LazyLock::new(|| { vec![ @@ -244,6 +244,24 @@ fn session_specific_overrides() -> &'static [ConfigOverride] { value: serde_json::json!(["tcp/localhost:7447"]), reason: "Connect to Zenoh router on localhost at standard ROS 2 port 7447", }, + // These two settings had no value here before. Each one used + // Zenoh's own default instead of rmw_zenoh_cpp's ROS setting + // (DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5). When no router is + // present, a peer's connect attempt has no target to reach. No + // test checked Zenoh's default behavior for that case: the + // retry duration, and whether it blocks session start. In + // rmw_zenoh_cpp, a failed peer connect does not stop the + // session and does not block it. + ConfigOverride { + key: "connect/timeout_ms", + value: serde_json::json!({"router": -1, "peer": -1, "client": 0}), + reason: "Matches rmw_zenoh_cpp's default: -1 for peer and router means the connect does not block session start, not that it waits forever", + }, + ConfigOverride { + key: "connect/exit_on_failure", + value: serde_json::json!({"router": false, "peer": false, "client": true}), + reason: "Matches rmw_zenoh_cpp's default: a peer with no reachable router must not fail session creation; only a client, which needs one, does", + }, ConfigOverride { key: "listen/endpoints", value: serde_json::json!(["tcp/localhost:0"]), From 798b7c9fc12e8ae90684f85e68e655307e1ce2aa Mon Sep 17 00:00:00 2001 From: yuanyuyuan Date: Wed, 23 Sep 2026 15:43:28 +0800 Subject: [PATCH 2/2] fix(config): drop narrative comment, keep per-key reason The block comment restated investigation detail already covered by each override's own reason field, and stood out against every other entry in this list, which carries no leading comment. --- crates/hiroz/src/config.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/crates/hiroz/src/config.rs b/crates/hiroz/src/config.rs index 74647b87d..d1d86a4b9 100644 --- a/crates/hiroz/src/config.rs +++ b/crates/hiroz/src/config.rs @@ -244,14 +244,6 @@ fn session_specific_overrides() -> &'static [ConfigOverride] { value: serde_json::json!(["tcp/localhost:7447"]), reason: "Connect to Zenoh router on localhost at standard ROS 2 port 7447", }, - // These two settings had no value here before. Each one used - // Zenoh's own default instead of rmw_zenoh_cpp's ROS setting - // (DEFAULT_RMW_ZENOH_SESSION_CONFIG.json5). When no router is - // present, a peer's connect attempt has no target to reach. No - // test checked Zenoh's default behavior for that case: the - // retry duration, and whether it blocks session start. In - // rmw_zenoh_cpp, a failed peer connect does not stop the - // session and does not block it. ConfigOverride { key: "connect/timeout_ms", value: serde_json::json!({"router": -1, "peer": -1, "client": 0}),