-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rework how DeterministicRunnerImpl and SyncWorkflowContext handle creation of workflow root and method threads #557
Rework how DeterministicRunnerImpl and SyncWorkflowContext handle creation of workflow root and method threads #557
Conversation
c90eaf6
to
e2d42f2
Compare
temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkflowInboundCallsInterceptor.java
Outdated
Show resolved
Hide resolved
...oral-sdk/src/main/java/io/temporal/common/interceptors/WorkflowOutboundCallsInterceptor.java
Outdated
Show resolved
Hide resolved
threads.add(c); | ||
} | ||
threadsToAdd.clear(); | ||
workflowThreadsToAdd.clear(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do the same for the callback threads to add?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's actually what I did in this PR, I made a collection callbackThreadsToAdd
that works almost the same way (just traversed in a reversed order when we add to threads
)
temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/sync/SyncWorkflowContext.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/common/interceptors/WorkflowInboundCallsInterceptor.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowThreadImpl.java
Outdated
Show resolved
Hide resolved
28dc52a
to
c4be0e0
Compare
...ral-sdk/src/main/java/io/temporal/internal/sync/BaseRootWorkflowInboundCallsInterceptor.java
Outdated
Show resolved
Hide resolved
...ral-sdk/src/main/java/io/temporal/internal/sync/BaseRootWorkflowInboundCallsInterceptor.java
Outdated
Show resolved
Hide resolved
temporal-sdk/src/main/java/io/temporal/internal/sync/WorkflowThreadImpl.java
Show resolved
Hide resolved
49a4200
to
344b797
Compare
344b797
to
3192980
Compare
…reation of workflow root and method threads
Refactored workflow root thread into a separate code path making it explicitly different from workflow-method thread and child workflows.
Added WorkflowInboundCallsInterceptor#newWorkflowMethodThread intercepting creation of the main workflow-method thread.
Added WorkflowInboundCallsInterceptor#newCallbackThread intercepting creation of a callback thread.
WorkflowOutboundCallsInterceptor#newThread is renamed into WorkflowOutboundCallsInterceptor#newChildThread and now it intercepts only new workflow child threads and doesn't intercept creation of the main workflow-method thread.
Fixed situation that the same "workflow-method" name was used for workflow initializer thread (now called "workflow-root") and for the thread that is used to run a workflow method (continued to be "workflow-method").
This PR is a first step to address issue #537