Fix WorkerOptions.Builder.isUsingVirtualThreadsOnWorkflowWorker - #2957
Merged
dplyukhin merged 4 commits intoJul 23, 2026
Conversation
returning the wrong field
…nWorkflowWorker-fix
…nWorkflowWorker-fix
…nWorkflowWorker-fix
dplyukhin
approved these changes
Jul 23, 2026
butcherless
pushed a commit
to butcherless/temporal-saga-pattern
that referenced
this pull request
Aug 11, 2026
Every *ActivitiesImpl method (Inventory/Payment/Order) ends in exactly one blocking WebClient#block() call and does no CPU-bound work in between -- the textbook virtual-thread case: one thread parked per in-flight HTTP call, no synchronized blocks in the path. VirtualThreadWorkerOptionsCustomizer sets WorkerOptions.Builder#setUsingVirtualThreadsOnActivityWorker(true) -- picked up automatically by temporal-spring-boot-starter, applied after the YAML-driven config. Deliberately scoped to the Activity worker only (not setUsingVirtualThreads, which would also flip Workflow task execution) -- Temporal's deterministic-replay machinery for Workflow tasks stays on platform threads. That scoping only actually holds as of temporal-sdk 1.38.0: bumps temporal.version from 1.37.0, fixing a copy-paste bug in WorkerOptions#isUsingVirtualThreadsOnWorkflowWorker() (returned the Activity worker's flag instead of its own -- see temporalio/sdk-java#2957) that Worker.java's real construction path reads when building the Workflow poller/executor. Without the bump, enabling Activity-worker virtual threads would have silently also flipped the Workflow worker onto them. Verified: unit test asserts the fixed getter now correctly reports the Workflow worker as unaffected; full reactor build green on 1.38.0; real Spring context boot confirmed the customizer wires up without error; and e2e-temporary-inventory-retry.sh passed end-to-end against the real docker-compose stack (multiple Activity invocations across a retry boundary, the best available stress case for the new executor). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
What was changed
WorkerOptions.Builder.isUsingVirtualThreadsOnWorkflowWorker was returning the value of WorkerOptions.Builder.usingVirtualThreadsOnActivityWorker instead of WorkerOptions.Builder.usingVirtualThreadsOnWorkflowWorker. This change corrects it to use the correct field.
Checklist
Closes WorkerOptions isUsingVirtualThreadsOnWorkflowWorker issue #2745
How was this tested:
New testcases were added to WorkerflowOptionsTest and tests were verified as passing.
Any docs updates needed?
No