Skip to content

Fix WorkerOptions.Builder.isUsingVirtualThreadsOnWorkflowWorker - #2957

Merged
dplyukhin merged 4 commits into
temporalio:mainfrom
geraldw-ai:workeroptions-builder-isUsingVirtualThreadsOnWorkflowWorker-fix
Jul 23, 2026
Merged

Fix WorkerOptions.Builder.isUsingVirtualThreadsOnWorkflowWorker#2957
dplyukhin merged 4 commits into
temporalio:mainfrom
geraldw-ai:workeroptions-builder-isUsingVirtualThreadsOnWorkflowWorker-fix

Conversation

@geraldw-ai

Copy link
Copy Markdown
Contributor

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

  1. Closes WorkerOptions isUsingVirtualThreadsOnWorkflowWorker issue #2745

  2. How was this tested:
    New testcases were added to WorkerflowOptionsTest and tests were verified as passing.

  3. Any docs updates needed?
    No

@geraldw-ai
geraldw-ai requested a review from a team as a code owner July 21, 2026 00:39
@CLAassistant

CLAassistant commented Jul 21, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dplyukhin dplyukhin self-assigned this Jul 23, 2026
@dplyukhin
dplyukhin merged commit 4804646 into temporalio:main Jul 23, 2026
16 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

WorkerOptions isUsingVirtualThreadsOnWorkflowWorker issue

3 participants