Skip to content

Commit c279982

Browse files
authored
fix: Improve debug messages in zenoh-transport (#1090)
* fix: Improve debug messages for failing RX/TX tasks * fix: Improve debug message for `accept_link` timeout * chore: Fix `clippy::redundant_pattern_matching` error
1 parent ce43f58 commit c279982

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

io/zenoh-transport/src/multicast/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ impl TransportLinkMulticastUniversal {
342342
)
343343
.await;
344344
if let Err(e) = res {
345-
tracing::debug!("{}", e);
345+
tracing::debug!("TX task failed: {}", e);
346346
// Spawn a task to avoid a deadlock waiting for this same task
347347
// to finish in the close() joining its handle
348348
zenoh_runtime::ZRuntime::Net.spawn(async move { c_transport.delete().await });
@@ -378,7 +378,7 @@ impl TransportLinkMulticastUniversal {
378378
.await;
379379
c_signal.trigger();
380380
if let Err(e) = res {
381-
tracing::debug!("{}", e);
381+
tracing::debug!("RX task failed: {}", e);
382382
// Spawn a task to avoid a deadlock waiting for this same task
383383
// to finish in the close() joining its handle
384384
zenoh_runtime::ZRuntime::Net.spawn(async move { c_transport.delete().await });

io/zenoh-transport/src/unicast/manager.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,13 +746,17 @@ impl TransportManager {
746746
let c_manager = self.clone();
747747
self.task_controller
748748
.spawn_with_rt(zenoh_runtime::ZRuntime::Acceptor, async move {
749-
if let Err(e) = tokio::time::timeout(
749+
if tokio::time::timeout(
750750
c_manager.config.unicast.accept_timeout,
751751
super::establishment::accept::accept_link(link, &c_manager),
752752
)
753753
.await
754+
.is_err()
754755
{
755-
tracing::debug!("{}", e);
756+
tracing::debug!(
757+
"Failed to accept link before deadline ({}ms)",
758+
c_manager.config.unicast.accept_timeout.as_millis()
759+
);
756760
}
757761
incoming_counter.fetch_sub(1, SeqCst);
758762
});

io/zenoh-transport/src/unicast/universal/link.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ impl TransportLinkUnicastUniversal {
9797
.await;
9898

9999
if let Err(e) = res {
100-
tracing::debug!("{}", e);
100+
tracing::debug!("TX task failed: {}", e);
101101
// Spawn a task to avoid a deadlock waiting for this same task
102102
// to finish in the close() joining its handle
103103
// TODO(yuyuan): do more study to check which ZRuntime should be used or refine the
@@ -125,7 +125,7 @@ impl TransportLinkUnicastUniversal {
125125

126126
// TODO(yuyuan): improve this callback
127127
if let Err(e) = res {
128-
tracing::debug!("{}", e);
128+
tracing::debug!("RX task failed: {}", e);
129129

130130
// Spawn a task to avoid a deadlock waiting for this same task
131131
// to finish in the close() joining its handle

0 commit comments

Comments
 (0)