Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inform users that peers will not discover and communicate with one another until the router is started (backport #440) #444

Merged
merged 1 commit into from
Feb 2, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions rmw_zenoh_cpp/src/detail/rmw_context_impl_s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ class rmw_context_impl_s::Data final : public std::enable_shared_from_this<Data>
"Have you started a router with `ros2 run rmw_zenoh_cpp rmw_zenohd`?");
}
if (++connection_attempts >= configured_connection_attempts.value()) {
RMW_ZENOH_LOG_WARN_NAMED(
"rmw_zenoh_cpp",
"Unable to connect to a Zenoh router after %zu attempt(s). "
"Please ensure that a Zenoh router is running and can be reached. "
"You may increase the number of attempts to check for a router by "
"setting the ZENOH_ROUTER_CHECK_ATTEMPTS environment variable. "
"Proceeding with initialization but other peers will not discover "
"or receive data from peers in this session until a router is started.",
configured_connection_attempts.value());
break;
}
std::this_thread::sleep_for(sleep_time);
Expand Down