Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Yadunund <yadunund@openrobotics.org>
  • Loading branch information
Yadunund committed Jan 12, 2024
1 parent 641e542 commit 26fca70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion rmw_zenoh_cpp/src/detail/graph_cache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 5 additions & 4 deletions rmw_zenoh_cpp/src/rmw_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 26fca70

Please sign in to comment.