From ef1034eaa6f27ab1ce08f6804f94f88551af79c9 Mon Sep 17 00:00:00 2001 From: OlivierHecart Date: Mon, 5 Feb 2024 13:00:29 +0100 Subject: [PATCH] Improve routing logging --- zenoh/src/net/routing/dispatcher/face.rs | 2 +- zenoh/src/net/routing/dispatcher/pubsub.rs | 50 ++++++++++++++----- zenoh/src/net/routing/dispatcher/queries.rs | 32 +++++++++--- zenoh/src/net/routing/dispatcher/resource.rs | 14 ++++-- zenoh/src/net/routing/hat/client/mod.rs | 4 +- zenoh/src/net/routing/hat/client/pubsub.rs | 5 +- zenoh/src/net/routing/hat/client/queries.rs | 2 - .../src/net/routing/hat/linkstate_peer/mod.rs | 6 +-- .../net/routing/hat/linkstate_peer/pubsub.rs | 15 +----- .../net/routing/hat/linkstate_peer/queries.rs | 8 --- zenoh/src/net/routing/hat/p2p_peer/mod.rs | 4 +- zenoh/src/net/routing/hat/p2p_peer/pubsub.rs | 5 +- zenoh/src/net/routing/hat/p2p_peer/queries.rs | 2 - zenoh/src/net/routing/hat/router/mod.rs | 7 +-- zenoh/src/net/routing/hat/router/pubsub.rs | 25 +--------- zenoh/src/net/routing/hat/router/queries.rs | 18 ------- 16 files changed, 88 insertions(+), 111 deletions(-) diff --git a/zenoh/src/net/routing/dispatcher/face.rs b/zenoh/src/net/routing/dispatcher/face.rs index efd1c039eb..54af7a01ee 100644 --- a/zenoh/src/net/routing/dispatcher/face.rs +++ b/zenoh/src/net/routing/dispatcher/face.rs @@ -204,7 +204,7 @@ impl Primitives for Face { pull_data(&self.tables.tables, &self.state.clone(), msg.wire_expr); } _ => { - log::error!("Unsupported request"); + log::error!("{} Unsupported request!", self); } } } diff --git a/zenoh/src/net/routing/dispatcher/pubsub.rs b/zenoh/src/net/routing/dispatcher/pubsub.rs index b5335621e8..4de75f4854 100644 --- a/zenoh/src/net/routing/dispatcher/pubsub.rs +++ b/zenoh/src/net/routing/dispatcher/pubsub.rs @@ -39,13 +39,19 @@ pub(crate) fn declare_subscription( sub_info: &SubscriberInfo, node_id: NodeId, ) { - log::debug!("Declare subscription {}", face); let rtables = zread!(tables.tables); match rtables .get_mapping(face, &expr.scope, expr.mapping) .cloned() { Some(mut prefix) => { + log::debug!( + "{} Declare subscriber {} ({}{})", + face, + id, + prefix.expr(), + expr.suffix + ); let res = Resource::get_resource(&prefix, &expr.suffix); let (mut res, mut wtables) = if res.as_ref().map(|r| r.context.is_some()).unwrap_or(false) { @@ -87,7 +93,12 @@ pub(crate) fn declare_subscription( } drop(wtables); } - None => log::error!("Declare subscription for unknown scope {}!", expr.scope), + None => log::error!( + "{} Declare subscriber {} for unknown scope {}!", + face, + id, + expr.scope + ), } } @@ -99,7 +110,6 @@ pub(crate) fn undeclare_subscription( expr: &WireExpr, node_id: NodeId, ) { - log::debug!("Undeclare subscription {}", face); let res = if expr.is_empty() { None } else { @@ -108,18 +118,30 @@ pub(crate) fn undeclare_subscription( Some(prefix) => match Resource::get_resource(prefix, expr.suffix.as_ref()) { Some(res) => Some(res), None => { - log::error!("Undeclare unknown subscription!"); + if log::log_enabled!(log::Level::Error) { + log::error!( + "{} Undeclare unknown subscriber {}{}!", + face, + prefix.expr(), + expr.suffix + ); + } return; } }, None => { - log::error!("Undeclare subscription with unknown scope!"); + log::error!( + "{} Undeclare subscriber with unknown scope {}", + face, + expr.scope + ); return; } } }; let mut wtables = zwrite!(tables.tables); if let Some(mut res) = hat_code.undeclare_subscription(&mut wtables, face, id, res, node_id) { + log::debug!("{} Undeclare subscriber {} ({})", face, id, res.expr()); disable_matches_data_routes(&mut wtables, &mut res); drop(wtables); @@ -139,7 +161,7 @@ pub(crate) fn undeclare_subscription( Resource::clean(&mut res); drop(wtables); } else { - log::error!("Undeclare unknown subscription {}:{}", face, id); + log::error!("{} Undeclare unknown subscriber {}", face, id); } } @@ -447,7 +469,8 @@ pub fn full_reentrant_route_data( match tables.get_mapping(face, &expr.scope, expr.mapping).cloned() { Some(prefix) => { log::trace!( - "Route data for res {}{}", + "{} Route data for res {}{}", + face, prefix.expr(), expr.suffix.as_ref() ); @@ -563,7 +586,7 @@ pub fn full_reentrant_route_data( } } None => { - log::error!("Route data with unknown scope {}!", expr.scope); + log::error!("{} Route data with unknown scope {}!", face, expr.scope); } } } @@ -604,14 +627,16 @@ pub fn pull_data(tables_ref: &RwLock, face: &Arc, expr: WireE } None => { log::error!( - "Pull data for unknown subscription {} (no info)!", + "{} Pull data for unknown subscriber {} (no info)!", + face, prefix.expr() + expr.suffix.as_ref() ); } }, None => { log::error!( - "Pull data for unknown subscription {} (no context)!", + "{} Pull data for unknown subscriber {} (no context)!", + face, prefix.expr() + expr.suffix.as_ref() ); } @@ -619,13 +644,14 @@ pub fn pull_data(tables_ref: &RwLock, face: &Arc, expr: WireE } None => { log::error!( - "Pull data for unknown subscription {} (no resource)!", + "{} Pull data for unknown subscriber {} (no resource)!", + face, prefix.expr() + expr.suffix.as_ref() ); } }, None => { - log::error!("Pull data with unknown scope {}!", expr.scope); + log::error!("{} Pull data with unknown scope {}!", face, expr.scope); } }; } diff --git a/zenoh/src/net/routing/dispatcher/queries.rs b/zenoh/src/net/routing/dispatcher/queries.rs index 9645af0f74..65193d41ac 100644 --- a/zenoh/src/net/routing/dispatcher/queries.rs +++ b/zenoh/src/net/routing/dispatcher/queries.rs @@ -48,13 +48,18 @@ pub(crate) fn declare_queryable( qabl_info: &QueryableInfo, node_id: NodeId, ) { - log::debug!("Register queryable {}", face); let rtables = zread!(tables.tables); match rtables .get_mapping(face, &expr.scope, expr.mapping) .cloned() { Some(mut prefix) => { + log::debug!( + "{} Declare queryable ({}{})", + face, + prefix.expr(), + expr.suffix + ); let res = Resource::get_resource(&prefix, &expr.suffix); let (mut res, mut wtables) = if res.as_ref().map(|r| r.context.is_some()).unwrap_or(false) { @@ -93,7 +98,11 @@ pub(crate) fn declare_queryable( } drop(wtables); } - None => log::error!("Declare queryable for unknown scope {}!", expr.scope), + None => log::error!( + "{} Declare queryable for unknown scope {}!", + face, + expr.scope + ), } } @@ -108,6 +117,7 @@ pub(crate) fn undeclare_queryable( match rtables.get_mapping(face, &expr.scope, expr.mapping) { Some(prefix) => match Resource::get_resource(prefix, expr.suffix.as_ref()) { Some(mut res) => { + log::debug!("{} Undeclare queryable ({})", face, res.expr()); drop(rtables); let mut wtables = zwrite!(tables.tables); @@ -129,9 +139,18 @@ pub(crate) fn undeclare_queryable( Resource::clean(&mut res); drop(wtables); } - None => log::error!("Undeclare unknown queryable!"), + None => log::error!( + "{} Undeclare unknown queryable ({}{})!", + face, + prefix.expr(), + expr.suffix + ), }, - None => log::error!("Undeclare queryable with unknown scope!"), + None => log::error!( + "{} Undeclare queryable with unknown scope {}!", + face, + expr.scope + ), } } @@ -680,8 +699,9 @@ pub fn route_query( } None => { log::error!( - "Route query with unknown scope {}! Send final reply.", - expr.scope + "{} Route query with unknown scope {}! Send final reply.", + face, + expr.scope, ); drop(rtables); face.primitives diff --git a/zenoh/src/net/routing/dispatcher/resource.rs b/zenoh/src/net/routing/dispatcher/resource.rs index 7fc71c623d..edffe41d1b 100644 --- a/zenoh/src/net/routing/dispatcher/resource.rs +++ b/zenoh/src/net/routing/dispatcher/resource.rs @@ -649,7 +649,11 @@ pub fn register_expr( let mut fullexpr = prefix.expr(); fullexpr.push_str(expr.suffix.as_ref()); if res.expr() != fullexpr { - log::error!("Resource {} remapped. Remapping unsupported!", expr_id); + log::error!( + "{} Resource {} remapped. Remapping unsupported!", + face, + expr_id + ); } } None => { @@ -697,7 +701,11 @@ pub fn register_expr( drop(wtables); } }, - None => log::error!("Declare resource with unknown scope {}!", expr.scope), + None => log::error!( + "{} Declare resource with unknown scope {}!", + face, + expr.scope + ), } } @@ -705,7 +713,7 @@ pub fn unregister_expr(tables: &TablesLock, face: &mut Arc, expr_id: let wtables = zwrite!(tables.tables); match get_mut_unchecked(face).remote_mappings.remove(&expr_id) { Some(mut res) => Resource::clean(&mut res), - None => log::error!("Undeclare unknown resource!"), + None => log::error!("{} Undeclare unknown resource!", face), } drop(wtables); } diff --git a/zenoh/src/net/routing/hat/client/mod.rs b/zenoh/src/net/routing/hat/client/mod.rs index 9c7b85f1e5..8caa87d2b8 100644 --- a/zenoh/src/net/routing/hat/client/mod.rs +++ b/zenoh/src/net/routing/hat/client/mod.rs @@ -131,7 +131,7 @@ impl HatBaseTrait for HatCode { face.local_mappings.clear(); let mut subs_matches = vec![]; - for (id, mut res) in face + for (_id, mut res) in face .hat .downcast_mut::() .unwrap() @@ -139,7 +139,7 @@ impl HatBaseTrait for HatCode { .drain() { get_mut_unchecked(&mut res).session_ctxs.remove(&face.id); - undeclare_client_subscription(&mut wtables, &mut face_clone, id, &mut res); + undeclare_client_subscription(&mut wtables, &mut face_clone, &mut res); if res.context.is_some() { for match_ in &res.context().matches { diff --git a/zenoh/src/net/routing/hat/client/pubsub.rs b/zenoh/src/net/routing/hat/client/pubsub.rs index d0293c0982..3ea32d4079 100644 --- a/zenoh/src/net/routing/hat/client/pubsub.rs +++ b/zenoh/src/net/routing/hat/client/pubsub.rs @@ -92,7 +92,6 @@ fn register_client_subscription( // Register subscription { let res = get_mut_unchecked(res); - log::debug!("Register subscription {} for {}", res.expr(), face); match res.session_ctxs.get_mut(&face.id) { Some(ctx) => match &ctx.subs { Some(info) => { @@ -192,10 +191,8 @@ fn propagate_forget_simple_subscription(tables: &mut Tables, res: &Arc pub(super) fn undeclare_client_subscription( tables: &mut Tables, face: &mut Arc, - id: SubscriberId, res: &mut Arc, ) { - log::debug!("Unregister client subscription {} for {}", id, face); if !face_hat_mut!(face).remote_subs.values().any(|s| *s == *res) { if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).subs = None; @@ -233,7 +230,7 @@ fn forget_client_subscription( id: SubscriberId, ) -> Option> { if let Some(mut res) = face_hat_mut!(face).remote_subs.remove(&id) { - undeclare_client_subscription(tables, face, id, &mut res); + undeclare_client_subscription(tables, face, &mut res); Some(res) } else { None diff --git a/zenoh/src/net/routing/hat/client/queries.rs b/zenoh/src/net/routing/hat/client/queries.rs index 35a10557dc..0f5b63fc2e 100644 --- a/zenoh/src/net/routing/hat/client/queries.rs +++ b/zenoh/src/net/routing/hat/client/queries.rs @@ -120,7 +120,6 @@ fn register_client_queryable( // Register queryable { let res = get_mut_unchecked(res); - log::debug!("Register queryable {} (face: {})", res.expr(), face,); get_mut_unchecked(res.session_ctxs.entry(face.id).or_insert_with(|| { Arc::new(SessionContext { face: face.clone(), @@ -187,7 +186,6 @@ pub(super) fn undeclare_client_queryable( face: &mut Arc, res: &mut Arc, ) { - log::debug!("Unregister client queryable {} for {}", res.expr(), face); if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).qabl = None; if ctx.qabl.is_none() { diff --git a/zenoh/src/net/routing/hat/linkstate_peer/mod.rs b/zenoh/src/net/routing/hat/linkstate_peer/mod.rs index 980baa5df1..8434549682 100644 --- a/zenoh/src/net/routing/hat/linkstate_peer/mod.rs +++ b/zenoh/src/net/routing/hat/linkstate_peer/mod.rs @@ -130,7 +130,6 @@ impl HatTables { } fn schedule_compute_trees(&mut self, tables_ref: Arc) { - log::trace!("Schedule computations"); if self.peers_trees_task.is_none() { let task = Some(async_std::task::spawn(async move { async_std::task::sleep(std::time::Duration::from_millis( @@ -146,7 +145,6 @@ impl HatTables { pubsub::pubsub_tree_change(&mut tables, &new_childs); queries::queries_tree_change(&mut tables, &new_childs); - log::trace!("Computations completed"); hat_mut!(tables).peers_trees_task = None; })); self.peers_trees_task = task; @@ -252,7 +250,7 @@ impl HatBaseTrait for HatCode { face.local_mappings.clear(); let mut subs_matches = vec![]; - for (id, mut res) in face + for (_id, mut res) in face .hat .downcast_mut::() .unwrap() @@ -260,7 +258,7 @@ impl HatBaseTrait for HatCode { .drain() { get_mut_unchecked(&mut res).session_ctxs.remove(&face.id); - undeclare_client_subscription(&mut wtables, &mut face_clone, id, &mut res); + undeclare_client_subscription(&mut wtables, &mut face_clone, &mut res); if res.context.is_some() { for match_ in &res.context().matches { diff --git a/zenoh/src/net/routing/hat/linkstate_peer/pubsub.rs b/zenoh/src/net/routing/hat/linkstate_peer/pubsub.rs index 39b39ab7d7..a4ca166970 100644 --- a/zenoh/src/net/routing/hat/linkstate_peer/pubsub.rs +++ b/zenoh/src/net/routing/hat/linkstate_peer/pubsub.rs @@ -55,8 +55,6 @@ fn send_sourced_subscription_to_net_childs( if src_face.is_none() || someface.id != src_face.unwrap().id { let key_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send subscription {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -174,7 +172,6 @@ fn register_peer_subscription( if !res_hat!(res).peer_subs.contains(&peer) { // Register peer subscription { - log::debug!("Register peer subscription {} (peer: {})", res.expr(), peer); res_hat_mut!(res).peer_subs.insert(peer); hat_mut!(tables).peer_subs.insert(res.clone()); } @@ -209,7 +206,6 @@ fn register_client_subscription( // Register subscription { let res = get_mut_unchecked(res); - log::debug!("Register subscription {} for {}", res.expr(), face); match res.session_ctxs.get_mut(&face.id) { Some(ctx) => match &ctx.subs { Some(info) => { @@ -292,8 +288,6 @@ fn send_forget_sourced_subscription_to_net_childs( if src_face.is_none() || someface.id != src_face.unwrap().id { let wire_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send forget subscription {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -371,11 +365,6 @@ fn propagate_forget_sourced_subscription( } fn unregister_peer_subscription(tables: &mut Tables, res: &mut Arc, peer: &ZenohId) { - log::debug!( - "Unregister peer subscription {} (peer: {})", - res.expr(), - peer - ); res_hat_mut!(res).peer_subs.retain(|sub| sub != peer); if res_hat!(res).peer_subs.is_empty() { @@ -413,10 +402,8 @@ fn forget_peer_subscription( pub(super) fn undeclare_client_subscription( tables: &mut Tables, face: &mut Arc, - id: SubscriberId, res: &mut Arc, ) { - log::debug!("Unregister client subscription {} for {}", id, face); if !face_hat_mut!(face).remote_subs.values().any(|s| *s == *res) { if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).subs = None; @@ -455,7 +442,7 @@ fn forget_client_subscription( id: SubscriberId, ) -> Option> { if let Some(mut res) = face_hat_mut!(face).remote_subs.remove(&id) { - undeclare_client_subscription(tables, face, id, &mut res); + undeclare_client_subscription(tables, face, &mut res); Some(res) } else { None diff --git a/zenoh/src/net/routing/hat/linkstate_peer/queries.rs b/zenoh/src/net/routing/hat/linkstate_peer/queries.rs index 6281993c93..50eb00023f 100644 --- a/zenoh/src/net/routing/hat/linkstate_peer/queries.rs +++ b/zenoh/src/net/routing/hat/linkstate_peer/queries.rs @@ -133,8 +133,6 @@ fn send_sourced_queryable_to_net_childs( if src_face.is_none() || someface.id != src_face.as_ref().unwrap().id { let key_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send queryable {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -240,7 +238,6 @@ fn register_peer_queryable( if current_info.is_none() || current_info.unwrap() != qabl_info { // Register peer queryable { - log::debug!("Register peer queryable {} (peer: {})", res.expr(), peer,); res_hat_mut!(res).peer_qabls.insert(peer, *qabl_info); hat_mut!(tables).peer_qabls.insert(res.clone()); } @@ -275,7 +272,6 @@ fn register_client_queryable( // Register queryable { let res = get_mut_unchecked(res); - log::debug!("Register queryable {} (face: {})", res.expr(), face,); get_mut_unchecked(res.session_ctxs.entry(face.id).or_insert_with(|| { Arc::new(SessionContext { face: face.clone(), @@ -343,8 +339,6 @@ fn send_forget_sourced_queryable_to_net_childs( if src_face.is_none() || someface.id != src_face.unwrap().id { let wire_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send forget queryable {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -425,7 +419,6 @@ fn propagate_forget_sourced_queryable( } fn unregister_peer_queryable(tables: &mut Tables, res: &mut Arc, peer: &ZenohId) { - log::debug!("Unregister peer queryable {} (peer: {})", res.expr(), peer,); res_hat_mut!(res).peer_qabls.remove(peer); if res_hat!(res).peer_qabls.is_empty() { @@ -465,7 +458,6 @@ pub(super) fn undeclare_client_queryable( face: &mut Arc, res: &mut Arc, ) { - log::debug!("Unregister client queryable {} for {}", res.expr(), face); if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).qabl = None; if ctx.qabl.is_none() { diff --git a/zenoh/src/net/routing/hat/p2p_peer/mod.rs b/zenoh/src/net/routing/hat/p2p_peer/mod.rs index 48bcbcc376..5b4503c51d 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/mod.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/mod.rs @@ -177,7 +177,7 @@ impl HatBaseTrait for HatCode { face.local_mappings.clear(); let mut subs_matches = vec![]; - for (id, mut res) in face + for (_id, mut res) in face .hat .downcast_mut::() .unwrap() @@ -185,7 +185,7 @@ impl HatBaseTrait for HatCode { .drain() { get_mut_unchecked(&mut res).session_ctxs.remove(&face.id); - undeclare_client_subscription(&mut wtables, &mut face_clone, id, &mut res); + undeclare_client_subscription(&mut wtables, &mut face_clone, &mut res); if res.context.is_some() { for match_ in &res.context().matches { diff --git a/zenoh/src/net/routing/hat/p2p_peer/pubsub.rs b/zenoh/src/net/routing/hat/p2p_peer/pubsub.rs index 6ffedd8d06..08873a3a1a 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/pubsub.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/pubsub.rs @@ -92,7 +92,6 @@ fn register_client_subscription( // Register subscription { let res = get_mut_unchecked(res); - log::debug!("Register subscription {} for {}", res.expr(), face); match res.session_ctxs.get_mut(&face.id) { Some(ctx) => match &ctx.subs { Some(info) => { @@ -192,10 +191,8 @@ fn propagate_forget_simple_subscription(tables: &mut Tables, res: &Arc pub(super) fn undeclare_client_subscription( tables: &mut Tables, face: &mut Arc, - id: SubscriberId, res: &mut Arc, ) { - log::debug!("Unregister client subscription {} for {}", id, face); if !face_hat_mut!(face).remote_subs.values().any(|s| *s == *res) { if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).subs = None; @@ -233,7 +230,7 @@ fn forget_client_subscription( id: SubscriberId, ) -> Option> { if let Some(mut res) = face_hat_mut!(face).remote_subs.remove(&id) { - undeclare_client_subscription(tables, face, id, &mut res); + undeclare_client_subscription(tables, face, &mut res); Some(res) } else { None diff --git a/zenoh/src/net/routing/hat/p2p_peer/queries.rs b/zenoh/src/net/routing/hat/p2p_peer/queries.rs index 35a10557dc..0f5b63fc2e 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/queries.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/queries.rs @@ -120,7 +120,6 @@ fn register_client_queryable( // Register queryable { let res = get_mut_unchecked(res); - log::debug!("Register queryable {} (face: {})", res.expr(), face,); get_mut_unchecked(res.session_ctxs.entry(face.id).or_insert_with(|| { Arc::new(SessionContext { face: face.clone(), @@ -187,7 +186,6 @@ pub(super) fn undeclare_client_queryable( face: &mut Arc, res: &mut Arc, ) { - log::debug!("Unregister client queryable {} for {}", res.expr(), face); if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).qabl = None; if ctx.qabl.is_none() { diff --git a/zenoh/src/net/routing/hat/router/mod.rs b/zenoh/src/net/routing/hat/router/mod.rs index d2c154fd48..60df3d8a37 100644 --- a/zenoh/src/net/routing/hat/router/mod.rs +++ b/zenoh/src/net/routing/hat/router/mod.rs @@ -236,14 +236,12 @@ impl HatTables { .as_ref() .map(|net| { let links = net.get_links(peer1); - log::debug!("failover_brokering {} {} ({:?})", peer1, peer2, links); HatTables::failover_brokering_to(links, peer2) }) .unwrap_or(false) } fn schedule_compute_trees(&mut self, tables_ref: Arc, net_type: WhatAmI) { - log::trace!("Schedule computations"); if (net_type == WhatAmI::Router && self.routers_trees_task.is_none()) || (net_type == WhatAmI::Peer && self.peers_trees_task.is_none()) { @@ -268,7 +266,6 @@ impl HatTables { pubsub::pubsub_tree_change(&mut tables, &new_childs, net_type); queries::queries_tree_change(&mut tables, &new_childs, net_type); - log::trace!("Computations completed"); match net_type { WhatAmI::Router => hat_mut!(tables).routers_trees_task = None, _ => hat_mut!(tables).peers_trees_task = None, @@ -422,7 +419,7 @@ impl HatBaseTrait for HatCode { face.local_mappings.clear(); let mut subs_matches = vec![]; - for (id, mut res) in face + for (_id, mut res) in face .hat .downcast_mut::() .unwrap() @@ -430,7 +427,7 @@ impl HatBaseTrait for HatCode { .drain() { get_mut_unchecked(&mut res).session_ctxs.remove(&face.id); - undeclare_client_subscription(&mut wtables, &mut face_clone, id, &mut res); + undeclare_client_subscription(&mut wtables, &mut face_clone, &mut res); if res.context.is_some() { for match_ in &res.context().matches { diff --git a/zenoh/src/net/routing/hat/router/pubsub.rs b/zenoh/src/net/routing/hat/router/pubsub.rs index 0f9ab2df94..0384e69646 100644 --- a/zenoh/src/net/routing/hat/router/pubsub.rs +++ b/zenoh/src/net/routing/hat/router/pubsub.rs @@ -55,8 +55,6 @@ fn send_sourced_subscription_to_net_childs( if src_face.is_none() || someface.id != src_face.unwrap().id { let key_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send subscription {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -191,11 +189,6 @@ fn register_router_subscription( if !res_hat!(res).router_subs.contains(&router) { // Register router subscription { - log::debug!( - "Register router subscription {} (router: {})", - res.expr(), - router - ); res_hat_mut!(res).router_subs.insert(router); hat_mut!(tables).router_subs.insert(res.clone()); } @@ -232,7 +225,6 @@ fn register_peer_subscription( if !res_hat!(res).peer_subs.contains(&peer) { // Register peer subscription { - log::debug!("Register peer subscription {} (peer: {})", res.expr(), peer); res_hat_mut!(res).peer_subs.insert(peer); hat_mut!(tables).peer_subs.insert(res.clone()); } @@ -266,7 +258,6 @@ fn register_client_subscription( // Register subscription { let res = get_mut_unchecked(res); - log::debug!("Register subscription {} for {}", res.expr(), face); match res.session_ctxs.get_mut(&face.id) { Some(ctx) => match &ctx.subs { Some(info) => { @@ -358,8 +349,6 @@ fn send_forget_sourced_subscription_to_net_childs( if src_face.is_none() || someface.id != src_face.unwrap().id { let wire_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send forget subscription {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -478,11 +467,6 @@ fn propagate_forget_sourced_subscription( } fn unregister_router_subscription(tables: &mut Tables, res: &mut Arc, router: &ZenohId) { - log::debug!( - "Unregister router subscription {} (router: {})", - res.expr(), - router - ); res_hat_mut!(res).router_subs.retain(|sub| sub != router); if res_hat!(res).router_subs.is_empty() { @@ -521,11 +505,6 @@ fn forget_router_subscription( } fn unregister_peer_subscription(tables: &mut Tables, res: &mut Arc, peer: &ZenohId) { - log::debug!( - "Unregister peer subscription {} (peer: {})", - res.expr(), - peer - ); res_hat_mut!(res).peer_subs.retain(|sub| sub != peer); if res_hat!(res).peer_subs.is_empty() { @@ -565,10 +544,8 @@ fn forget_peer_subscription( pub(super) fn undeclare_client_subscription( tables: &mut Tables, face: &mut Arc, - id: SubscriberId, res: &mut Arc, ) { - log::debug!("Unregister client subscription {} for {}", id, face); if !face_hat_mut!(face).remote_subs.values().any(|s| *s == *res) { if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).subs = None; @@ -610,7 +587,7 @@ fn forget_client_subscription( id: SubscriberId, ) -> Option> { if let Some(mut res) = face_hat_mut!(face).remote_subs.remove(&id) { - undeclare_client_subscription(tables, face, id, &mut res); + undeclare_client_subscription(tables, face, &mut res); Some(res) } else { None diff --git a/zenoh/src/net/routing/hat/router/queries.rs b/zenoh/src/net/routing/hat/router/queries.rs index 90944a524f..877c82f71f 100644 --- a/zenoh/src/net/routing/hat/router/queries.rs +++ b/zenoh/src/net/routing/hat/router/queries.rs @@ -204,8 +204,6 @@ fn send_sourced_queryable_to_net_childs( if src_face.is_none() || someface.id != src_face.as_ref().unwrap().id { let key_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send queryable {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -322,11 +320,6 @@ fn register_router_queryable( if current_info.is_none() || current_info.unwrap() != qabl_info { // Register router queryable { - log::debug!( - "Register router queryable {} (router: {})", - res.expr(), - router, - ); res_hat_mut!(res).router_qabls.insert(router, *qabl_info); hat_mut!(tables).router_qabls.insert(res.clone()); } @@ -375,7 +368,6 @@ fn register_peer_queryable( if current_info.is_none() || current_info.unwrap() != qabl_info { // Register peer queryable { - log::debug!("Register peer queryable {} (peer: {})", res.expr(), peer,); res_hat_mut!(res).peer_qabls.insert(peer, *qabl_info); hat_mut!(tables).peer_qabls.insert(res.clone()); } @@ -408,7 +400,6 @@ fn register_client_queryable( // Register queryable { let res = get_mut_unchecked(res); - log::debug!("Register queryable {} (face: {})", res.expr(), face,); get_mut_unchecked(res.session_ctxs.entry(face.id).or_insert_with(|| { Arc::new(SessionContext { face: face.clone(), @@ -484,8 +475,6 @@ fn send_forget_sourced_queryable_to_net_childs( if src_face.is_none() || someface.id != src_face.unwrap().id { let wire_expr = Resource::decl_key(res, &mut someface); - log::debug!("Send forget queryable {} on {}", res.expr(), someface); - someface.primitives.send_declare(RoutingContext::with_expr( Declare { ext_qos: ext::QoSType::declare_default(), @@ -608,11 +597,6 @@ fn propagate_forget_sourced_queryable( } fn unregister_router_queryable(tables: &mut Tables, res: &mut Arc, router: &ZenohId) { - log::debug!( - "Unregister router queryable {} (router: {})", - res.expr(), - router, - ); res_hat_mut!(res).router_qabls.remove(router); if res_hat!(res).router_qabls.is_empty() { @@ -651,7 +635,6 @@ fn forget_router_queryable( } fn unregister_peer_queryable(tables: &mut Tables, res: &mut Arc, peer: &ZenohId) { - log::debug!("Unregister peer queryable {} (peer: {})", res.expr(), peer,); res_hat_mut!(res).peer_qabls.remove(peer); if res_hat!(res).peer_qabls.is_empty() { @@ -697,7 +680,6 @@ pub(super) fn undeclare_client_queryable( face: &mut Arc, res: &mut Arc, ) { - log::debug!("Unregister client queryable {} for {}", res.expr(), face); if let Some(ctx) = get_mut_unchecked(res).session_ctxs.get_mut(&face.id) { get_mut_unchecked(ctx).qabl = None; if ctx.qabl.is_none() {