From d6d327df5e3065e8f3b617addee938222d7f22d6 Mon Sep 17 00:00:00 2001 From: Yadunund Date: Fri, 5 Jan 2024 14:00:09 +0800 Subject: [PATCH] Cleanup Signed-off-by: Yadunund --- rmw_zenoh_cpp/src/detail/graph_cache.cpp | 1 - rmw_zenoh_cpp/src/rmw_init.cpp | 9 +++++---- rmw_zenoh_cpp/src/rmw_zenoh.cpp | 6 ------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/rmw_zenoh_cpp/src/detail/graph_cache.cpp b/rmw_zenoh_cpp/src/detail/graph_cache.cpp index 3c552a90..80cd089a 100644 --- a/rmw_zenoh_cpp/src/detail/graph_cache.cpp +++ b/rmw_zenoh_cpp/src/detail/graph_cache.cpp @@ -963,7 +963,6 @@ rmw_ret_t GraphCache::get_entities_info_by_topic( return RMW_RET_OK; } - ///============================================================================= rmw_ret_t GraphCache::service_server_is_available( const char * service_name, diff --git a/rmw_zenoh_cpp/src/rmw_init.cpp b/rmw_zenoh_cpp/src/rmw_init.cpp index 201118c6..1b612d88 100644 --- a/rmw_zenoh_cpp/src/rmw_init.cpp +++ b/rmw_zenoh_cpp/src/rmw_init.cpp @@ -255,10 +255,11 @@ rmw_init(const rmw_init_options_t * options, rmw_context_t * context) "Sending Query '%s' to fetch discovery data...", liveliness_str.c_str() ); - // Without setting the bound value to 0, the liveliness get call - // block execution where there are more than 3 nodes in the graph. - // From the zenoh-c documentation: If `bound` is different from 0, that channel will be bound and apply back-pressure when full. - // TODO(Yadunund): Investigate why this is the case and try switching to callbacks instead. + // We create a blocking channel that is unbounded, ie. `bound` = 0, to receive + // replies for the zc_liveliness_get() call. This is necessary as if the `bound` + // is too low, the channel may starve the zenoh executor of its threads which + // would lead to deadlocks when trying to receive replies and block the + // execution here. z_owned_reply_channel_t channel = zc_reply_fifo_new(0); zc_liveliness_get( z_loan(context->impl->session), z_keyexpr(liveliness_str.c_str()), diff --git a/rmw_zenoh_cpp/src/rmw_zenoh.cpp b/rmw_zenoh_cpp/src/rmw_zenoh.cpp index 1f147888..8fa6d076 100644 --- a/rmw_zenoh_cpp/src/rmw_zenoh.cpp +++ b/rmw_zenoh_cpp/src/rmw_zenoh.cpp @@ -2174,12 +2174,6 @@ rmw_create_service( return nullptr; } } - // rmw_qos_profile_t adapted_qos_profile = - // rmw_dds_common::qos_profile_update_best_available_for_services(*qos_profile); - // if (!is_valid_qos(adapted_qos_profile)) { - // RMW_SET_ERROR_MSG("create_service() called with invalid QoS"); - // return nullptr; - // } RMW_CHECK_FOR_NULL_WITH_MSG( node->context,