File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -282,9 +282,11 @@ impl ComponentBuilder {
282282 if drt. request_plane ( ) . is_nats ( ) {
283283 let mut rx = drt. register_nats_service ( component. clone ( ) ) ;
284284 // Wait synchronously for the NATS service registration to complete.
285- // Uses blocking_recv() which bridges sync/async: the registration runs
286- // in a spawned async task, but we block here until it signals completion.
287- match rx. blocking_recv ( ) {
285+ // Uses block_in_place() to safely call blocking_recv() from async contexts.
286+ // This temporarily moves the current task off the runtime thread to allow
287+ // blocking without deadlocking the runtime.
288+ let result = tokio:: task:: block_in_place ( || rx. blocking_recv ( ) ) ;
289+ match result {
288290 Some ( Ok ( ( ) ) ) => {
289291 tracing:: debug!(
290292 component = component. service_name( ) ,
You can’t perform that action at this time.
0 commit comments