Repository navigation
Add actor reentrancy support for HTTP and gRPC hosts - #1867
Open
2748109647 wants to merge 3 commits into
Open
2748109647 wants to merge 3 commits into
2748109647 wants to merge 3 commits into
Conversation
Signed-off-by: Alpha <2748109647@qq.com>
Contributor
|
@2748109647 thanks for the PR. I don't want to ship reentrancy half done, and right now the sync path doesn't work. An actor method that calls another actor with Could you cover the sync path in this PR as well? One option is to also keep the id in a ThreadLocal around the method invocation. It needs a sync A -> B -> A test next to the async one. |
Synchronous actor methods can call another actor through a proxy that blocks on its own subscription. Reactor context is not propagated through that path, so the reentrancy id must be scoped around the actor method invocation and made available to the outgoing Dapr client call. Add a ThreadLocal fallback with nested-scope restoration and cover sync A -> B -> A calls for both HTTP and gRPC actor hosts. Signed-off-by: Alpha <2748109647@qq.com>
Signed-off-by: Alpha <2748109647@qq.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
enabledand optionalmaxStackDepth) to HTTP actor discovery and gRPC registration.Dapr-Reentrancy-Idthrough Reactor context for asynchronous calls, and use a scopedThreadLocalwhile invoking synchronous actor methods so nested.block()calls retain the reentrancy ID. The previous value is restored when the invocation scope exits.Validation
mvn -B -pl sdk-actors testpassed: 233 tests, 0 failures or errors.mvn -B -pl sdk-actors -am checkstyle:checkpassed with 0 violations.sdk-testsintegration test sources, includingActorReentrancyIT.ActorReentrancyITwas not run locally because Docker is unavailable in this environment.Fixes #1838