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 2f5c9fbc..797ed049 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) { diff --git a/zenoh_cpp_vendor/CMakeLists.txt b/zenoh_cpp_vendor/CMakeLists.txt index d67bb901..88804db0 100644 --- a/zenoh_cpp_vendor/CMakeLists.txt +++ b/zenoh_cpp_vendor/CMakeLists.txt @@ -22,9 +22,11 @@ set(RMW_ZENOH_BUILD_WITH_SHARED_MEMORY TRUE CACHE BOOL "Compile Zenoh RMW with S # 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_SHARED_MEMORY:BOOL=${RMW_ZENOH_BUILD_WITH_SHARED_MEMORY}" @@ -39,7 +41,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=ON -DZENOHCXX_ZENOHPICO=OFF