Repository navigation
Add worker IDs to Java gRPC requests - #314
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Failure completions after permanent payload-resolution errors bypass the header interceptor, omitting workerid and preventing the scheduler from attributing them to the worker.
1 open issue
What changed in this PR
Adds per-instance worker identity to Java worker gRPC requests so the scheduler can associate requests with individual workers without affecting clients sharing the same channel.
Changes:
- Generates a stable
hostname:pid:uuidID and attaches it through the worker’s stub. - Adds tests for ID format, uniqueness, shared-channel isolation, and stability across token refresh and reconnects.
- Documents the behavior in the changelog.
| File | Description |
|---|---|
client/src/test/java/com/microsoft/durabletask/OrchestratorChunkingTest.java |
Tests ID format, uniqueness, stability, and shared-channel isolation. |
client/src/main/java/com/microsoft/durabletask/DurableTaskGrpcWorker.java |
Generates worker IDs using Java 8-compatible APIs and attaches request metadata. |
CHANGELOG.md |
Records the new worker identity behavior. |
azuremanaged/src/test/java/com/microsoft/durabletask/azuremanaged/AudienceTransportTest.java |
Tests identity across token refresh and reconnects, plus invalid-PID handling. |
Review effort: Balanced
Varshitha Bachu (bachuv)
marked this pull request as ready for review
November 13, 2026 21:17
Tomer Rosenthal (torosent)
approved these changes
Nov 13, 2026
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.

Issue describing the changes in this PR
N/A - no linked issue.
Add a
workeridgRPC header so the scheduler can associate requests with individual Java worker instances. Generate ahostname:pid:uuidID once per worker instance and attach it through a worker-local channel wrapper before applying registered interceptors. This includes failure completions sent directly by the large-payload interceptor.The ID remains stable across requests, token refresh, and reconnects. Workers sharing a channel or builder retain distinct IDs, and clients using the shared channel do not acquire a worker ID. PID discovery remains compatible with Java 8, with explicit errors when the PID or hostname cannot be determined.
Pull request checklist
CHANGELOG.mdAdditional information
Validation passed:
.\gradlew.bat :client:test --tests '*OrchestratorChunkingTest' :azuremanaged:test --tests '*AudienceTransportTest' :azure-blob-payloads:test --tests '*LargePayloadInterceptorTest' -x :client:downloadProtoFiles --console=plain --quiet(68 tests, zero failures).Coverage verifies the hostname/PID/UUID format, per-worker uniqueness with shared builders and channels, stable IDs across repeated requests and transport reconnects, unchanged client requests, invalid-PID handling, and worker IDs on failure completions after a payload download returns HTTP 404. The protobuf download task is excluded to preserve the checked-in definitions.
Local DTS end-to-end validation also passed against
mcr.microsoft.com/dts/dts-emulator:latestand Azurite: 6 tests, zero failures or skips. This covers single activities, activity fan-out, sub-orchestrations, a 1.5 MB payload round trip, and scheduler redelivery after transient activity/orchestration upload failures. The actual DTS emulator logs recorded six distinct Java worker IDs in the expectedhostname:pid:uuidformat.Exact integration command: