From 01b6d8a1cf05efd8d4864041017c3d13a872131f Mon Sep 17 00:00:00 2001 From: yellowhatter Date: Mon, 21 Oct 2024 19:12:01 +0300 Subject: [PATCH] Async RX finalization --- io/zenoh-transport/src/unicast/universal/link.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/io/zenoh-transport/src/unicast/universal/link.rs b/io/zenoh-transport/src/unicast/universal/link.rs index 43e40595ca..a1d83f5c1d 100644 --- a/io/zenoh-transport/src/unicast/universal/link.rs +++ b/io/zenoh-transport/src/unicast/universal/link.rs @@ -152,8 +152,10 @@ impl TransportLinkUnicastUniversal { // transport.del_link((&rx.link).into()).await; } }; - // WARN: If this is on ZRuntime::TX, a deadlock would occur. - self.tracker.spawn_on(task, &zenoh_runtime::ZRuntime::RX); + + // we intentionally do not use tracker to be able to close the transport + // asynchronously with blocking operation in RX callback + zenoh_runtime::ZRuntime::RX.spawn(task); } pub(super) async fn close(self) -> ZResult<()> {