From 6f910bf06f1edf10990a3cef9a62d6075a8d7a3f Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Fri, 17 Jan 2025 17:28:27 +0100 Subject: [PATCH 1/2] Fix `ZENOH_ROUTER_CHECK_ATTEMPTS` which was not respected (#427) * Fix check of connection to a router * README: update ZENOH_ROUTER_CHECK_ATTEMPTS following default value change in #308 --- README.md | 12 ++++++++---- rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f9d883b1..fa6cdc3e 100644 --- a/README.md +++ b/README.md @@ -83,11 +83,15 @@ The `ZENOH_ROUTER_CHECK_ATTEMPTS` environment variable can be used to configure The behavior is explained in the table below. -| ZENOH_ROUTER_CHECK_ATTEMPTS | Session behavior | -|:---------------------------:|:----------------------------------------------------------------------------------------------------------------:| -| unset or 0 | Indefinitely waits for connection to a Zenoh router. | -| < 0 | Skips Zenoh router check. | +| ZENOH_ROUTER_CHECK_ATTEMPTS | Session behavior | +|:---------------------------:|:------------------------------------------------------------------------------------------------------------------:| +| 0 | Indefinitely waits for connection to a Zenoh router. | +| < 0 | Skips Zenoh router check. | | > 0 | Attempts to connect to a Zenoh router in `ZENOH_ROUTER_CHECK_ATTEMPTS` attempts with 1 second wait between checks. | +| unset | Equivalent to `1`: the check is made only once. | + +If after the configured number of attempts the Node is still not connected to a `Zenoh router`, the initialisation goes on anyway. +If a `Zenoh router` is started after initialization phase, the Node will automatically connect to it, and autoconnect to other Nodes if gossip scouting is enabled (true with default configuratiuon). ### Session and Router configs `rmw_zenoh` relies on separate configurations files to configure the `Zenoh router` and `Zenoh session` respectively. diff --git a/rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp b/rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp index 61dd9c8b..e6198f3a 100644 --- a/rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp +++ b/rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp @@ -100,8 +100,8 @@ class rmw_context_impl_s::Data final : public std::enable_shared_from_this constexpr int64_t ticks_between_print(std::chrono::milliseconds(1000) / sleep_time); do { zenoh::ZResult result; - this->session_->get_routers_z_id(&result); - if (result == Z_OK) { + const auto zids = this->session_->get_routers_z_id(&result); + if (result == Z_OK && !zids.empty()) { break; } if ((connection_attempts % ticks_between_print) == 0) { From bda2d7181d7e1ea2f7d143fabf7c4ffc6c670b20 Mon Sep 17 00:00:00 2001 From: "ChenYing Kuo (CY)" Date: Sat, 18 Jan 2025 00:52:03 +0800 Subject: [PATCH 2/2] Bump zenoh-c and zenoh-cpp to 1.1.1 (#424) * Bump zenoh-c and zenoh-cpp version. Signed-off-by: ChenYing Kuo * Bump zenoh-c and zenoh-cpp for last minute changes before 1.1.1 * Only keep the last PR improving performance Co-authored-by: yadunund Signed-off-by: ChenYing Kuo (CY) --------- Signed-off-by: ChenYing Kuo Signed-off-by: ChenYing Kuo (CY) Co-authored-by: Julien Enoch Co-authored-by: yadunund --- zenoh_cpp_vendor/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/zenoh_cpp_vendor/CMakeLists.txt b/zenoh_cpp_vendor/CMakeLists.txt index 57c45fbb..75a5ee2f 100644 --- a/zenoh_cpp_vendor/CMakeLists.txt +++ b/zenoh_cpp_vendor/CMakeLists.txt @@ -20,9 +20,11 @@ set(ZENOHC_CARGO_FLAGS "--no-default-features$--features=shared-memor # Set VCS_VERSION to include latest changes from zenoh/zenoh-c to benefit from : # - https://github.com/eclipse-zenoh/zenoh/pull/1685 (Fix deadlock in advanced subscription undeclaration) # - https://github.com/eclipse-zenoh/zenoh/pull/1696 (Fix SHM Garbage Collection (GC) policy) +# - https://github.com/eclipse-zenoh/zenoh/pull/1708 (Fix gossip with TLS endpoints) +# - https://github.com/eclipse-zenoh/zenoh/pull/1717 (Improve performance of a large number of peers) ament_vendor(zenoh_c_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-c.git - VCS_VERSION 61d8fcc136ce4ed36d921a32244da4f3d81a6097 + VCS_VERSION 328736fe9bb9b654b1d9f47eecfc6d52f0d7d587 CMAKE_ARGS "-DZENOHC_CARGO_FLAGS=${ZENOHC_CARGO_FLAGS}" "-DZENOHC_BUILD_WITH_UNSTABLE_API=TRUE" @@ -36,7 +38,7 @@ ament_export_dependencies(zenohc) # - https://github.com/eclipse-zenoh/zenoh-cpp/pull/363 (Fix memory leak in string deserialization) ament_vendor(zenoh_cpp_vendor VCS_URL https://github.com/eclipse-zenoh/zenoh-cpp - VCS_VERSION 05942637c29d3346ad18bab5a178aeebf4be5d62 + VCS_VERSION bbfef04e843289aae70b5aa060a925e8ee5b1b6f CMAKE_ARGS -DZENOHCXX_ZENOHC=OFF )