From eb0c327fa39ac7f3d67363f9c63eeb330ba06dbc Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Mon, 23 Sep 2024 10:38:03 +0200 Subject: [PATCH 1/2] Change liveliness tokens logs from warn to debug level --- rmw_zenoh_cpp/src/detail/graph_cache.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rmw_zenoh_cpp/src/detail/graph_cache.cpp b/rmw_zenoh_cpp/src/detail/graph_cache.cpp index 36f931f1..409713a5 100644 --- a/rmw_zenoh_cpp/src/detail/graph_cache.cpp +++ b/rmw_zenoh_cpp/src/detail/graph_cache.cpp @@ -595,8 +595,9 @@ void GraphCache::parse_del( return entity->zid() == node_it.second->zid_ && entity->nid() == node_it.second->nid_; }); if (node_it == range.second) { - // Node does not exist. - RMW_ZENOH_LOG_WARN_NAMED( + // Node does not exist or its liveliness token has been unregistered before one of its pubs/subs/service liveliness token. + // This could happen since Zenoh doesn't guarantee any order for unregistration events if the remote Node closed abruptly or was disconnected. + RMW_ZENOH_LOG_DEBUG_NAMED( "rmw_zenoh_cpp", "Received liveliness token to remove unknown node /%s from the graph. Ignoring...", entity->node_name().c_str() @@ -606,16 +607,16 @@ void GraphCache::parse_del( if (entity->type() == EntityType::Node) { // Node - // The liveliness tokens to remove pub/subs should be received before the one to remove a node - // given the reliability QoS for liveliness subs. However, if we find any pubs/subs present in - // the node below, we should update the count in graph_topics_. + // In case the remote Node closed abruptly or was disconnected, Zenoh could deliver the liveliness tokens unregistration events + // in any order. If the event for Node unregistration comes before the unregistration of its pubs/subs/services, + // we should update the count in graph_topics_ and graph_services_. const GraphNodePtr graph_node = node_it->second; if (!graph_node->pubs_.empty() || !graph_node->subs_.empty() || !graph_node->clients_.empty() || !graph_node->services_.empty()) { - RMW_ZENOH_LOG_WARN_NAMED( + RMW_ZENOH_LOG_DEBUG_NAMED( "rmw_zenoh_cpp", "Received liveliness token to remove node /%s from the graph before all pub/subs/" "clients/services for this node have been removed. Removing all entities first...", From 5f57e6f38208127ed225ef02094b0f07010fb455 Mon Sep 17 00:00:00 2001 From: Julien Enoch Date: Mon, 23 Sep 2024 10:52:36 +0200 Subject: [PATCH 2/2] fix lint --- rmw_zenoh_cpp/src/detail/graph_cache.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rmw_zenoh_cpp/src/detail/graph_cache.cpp b/rmw_zenoh_cpp/src/detail/graph_cache.cpp index 409713a5..04f8fd04 100644 --- a/rmw_zenoh_cpp/src/detail/graph_cache.cpp +++ b/rmw_zenoh_cpp/src/detail/graph_cache.cpp @@ -595,8 +595,9 @@ void GraphCache::parse_del( return entity->zid() == node_it.second->zid_ && entity->nid() == node_it.second->nid_; }); if (node_it == range.second) { - // Node does not exist or its liveliness token has been unregistered before one of its pubs/subs/service liveliness token. - // This could happen since Zenoh doesn't guarantee any order for unregistration events if the remote Node closed abruptly or was disconnected. + // Node does not exist or its liveliness token has been unregistered before one of its + // pubs/subs/service liveliness token. This could happen since Zenoh doesn't guarantee + // any order for unregistration events if the remote Node closed abruptly or was disconnected. RMW_ZENOH_LOG_DEBUG_NAMED( "rmw_zenoh_cpp", "Received liveliness token to remove unknown node /%s from the graph. Ignoring...", @@ -607,9 +608,10 @@ void GraphCache::parse_del( if (entity->type() == EntityType::Node) { // Node - // In case the remote Node closed abruptly or was disconnected, Zenoh could deliver the liveliness tokens unregistration events - // in any order. If the event for Node unregistration comes before the unregistration of its pubs/subs/services, - // we should update the count in graph_topics_ and graph_services_. + // In case the remote Node closed abruptly or was disconnected, Zenoh could deliver the + // liveliness tokens unregistration events in any order. + // If the event for Node unregistration comes before the unregistration of its + // pubs/subs/services, we should update the count in graph_topics_ and graph_services_. const GraphNodePtr graph_node = node_it->second; if (!graph_node->pubs_.empty() || !graph_node->subs_.empty() ||