Skip to content

Commit

Permalink
Merge commit 'bda2d7181d7e1ea2f7d143fabf7c4ffc6c670b20'
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowhatter committed Jan 21, 2025
2 parents c744418 + bda2d71 commit 4e71886
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ class rmw_context_impl_s::Data final : public std::enable_shared_from_this<Data>
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) {
Expand Down
6 changes: 4 additions & 2 deletions zenoh_cpp_vendor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down

0 comments on commit 4e71886

Please sign in to comment.