Skip to content

Commit 67aa299

Browse files
committed
address comment
1 parent 1d1f340 commit 67aa299

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/runtime/src/component.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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(),

0 commit comments

Comments
 (0)