You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support actor reentrancy (HTTP and gRPC actor host) #1838
The gRPC actor host added for #1761 (ActorRuntime.subscribeActorEvents()) does not support actor reentrancy, because the Java SDK has no reentrancy support today, over HTTP or gRPC.
What is missing
Config:ActorRuntimeConfig and ActorTypeConfig have no reentrancy setting. The initial request of SubscribeActorEventsAlpha1 has a reentrancy field (ActorReentrancyConfig), and the gRPC host leaves it unset. Over HTTP, /dapr/config does not return an entitiesConfig.reentrancy block either.
Propagation: daprd sends Dapr-Reentrancy-Id in the metadata of invoke, reminder and timer requests. The SDK does not forward it on outgoing actor calls made from inside an actor method, so a call back into the same actor chain blocks instead of re-entering.
Proposal
Add a reentrancy config (enabled, maxStackDepth) to ActorRuntimeConfig and ActorTypeConfig.
Send it in the gRPC initial request and in the HTTP /dapr/config response.
Carry the incoming Dapr-Reentrancy-Id through the actor call context, and attach it to actor invocations made by the actor while it handles that call.
Acceptance criteria
With reentrancy enabled, actor A → actor B → actor A completes instead of deadlocking, over both HTTP and the gRPC host.
Unit tests cover the config mapping. An integration test covers the reentrant call chain.
Hi @javier-aliaga, @cicoyle — I'd like to help with this and align on the context propagation design before implementing it.
I traced DaprController and ActorEventDispatcher into ActorRuntime. Neither entry path currently carries the incoming reentrancy ID into actor execution. On the outbound side, actors' DaprClientImpl.invoke() already uses Mono.deferContextual, but builds InvokeActorRequest beforehand from client-level metadata. That looks like a useful place to resolve invocation-specific metadata at subscription time.
My proposed approach:
Add global/per-actor-type reentrancy configuration and map it consistently to HTTP discovery JSON and the gRPC initial subscription request.
Capture Dapr-Reentrancy-Id at both host entry points, including reminder/timer callbacks, and propagate it through invocation-scoped Reactor context into outgoing actor requests without mutating shared client metadata.
Keep the default disabled behavior, with tests for HTTP/gRPC A → B → A, depth limits, and concurrent invocation isolation.
I also read the discussion in #545: the concerns about shared ID state, nested call chains and expanding public APIs still seem relevant. I'd first validate propagation through nested actor calls and scheduler switches with focused tests, rather than assume Reactor context alone solves every invocation style.
Is an internal Reactor-context approach the preferred direction, and are there existing compatibility expectations for blocking actor implementations that I should account for?
Activity
2748109647 commentedon Oct 23, 2026
Hi @javier-aliaga, @cicoyle — I'd like to help with this and align on the context propagation design before implementing it.
I traced
DaprControllerandActorEventDispatcherintoActorRuntime. Neither entry path currently carries the incoming reentrancy ID into actor execution. On the outbound side, actors'DaprClientImpl.invoke()already usesMono.deferContextual, but buildsInvokeActorRequestbeforehand from client-level metadata. That looks like a useful place to resolve invocation-specific metadata at subscription time.My proposed approach:
Dapr-Reentrancy-Idat both host entry points, including reminder/timer callbacks, and propagate it through invocation-scoped Reactor context into outgoing actor requests without mutating shared client metadata.I also read the discussion in #545: the concerns about shared ID state, nested call chains and expanding public APIs still seem relevant. I'd first validate propagation through nested actor calls and scheduler switches with focused tests, rather than assume Reactor context alone solves every invocation style.
Is an internal Reactor-context approach the preferred direction, and are there existing compatibility expectations for blocking actor implementations that I should account for?