File tree 1 file changed +10
-2
lines changed
io/zenoh-transport/src/unicast/lowlatency
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -132,7 +132,11 @@ impl TransportUnicastLowlatency {
132
132
c_transport. manager. config. zid,
133
133
c_transport. config. zid
134
134
) ;
135
- let _ = c_transport. finalize ( 0 ) . await ;
135
+
136
+ // Spawn a task to avoid a deadlock waiting for this same task
137
+ // to finish in the close() joining its handle
138
+ // WARN: Must be spawned on RX
139
+ zenoh_runtime:: ZRuntime :: RX . spawn ( async move { c_transport. finalize ( 0 ) . await } ) ;
136
140
}
137
141
} ;
138
142
self . tracker . spawn_on ( task, & ZRuntime :: TX ) ;
@@ -202,7 +206,11 @@ impl TransportUnicastLowlatency {
202
206
c_transport. manager. config. zid,
203
207
c_transport. config. zid
204
208
) ;
205
- let _ = c_transport. finalize ( 0 ) . await ;
209
+
210
+ // Spawn a task to avoid a deadlock waiting for this same task
211
+ // to finish in the close() joining its handle
212
+ // WARN: Must be spawned on RX
213
+ zenoh_runtime:: ZRuntime :: RX . spawn ( async move { c_transport. finalize ( 0 ) . await } ) ;
206
214
}
207
215
} ,
208
216
& ZRuntime :: RX ,
You can’t perform that action at this time.
0 commit comments