Microsoft durable worker dispatch mode plumbing - #3466
Draft
Steven (stevenhvtran) wants to merge 2 commits into
Draft
Microsoft durable worker dispatch mode plumbing#3466Steven (stevenhvtran) wants to merge 2 commits into
Steven (stevenhvtran) wants to merge 2 commits into
Conversation
…LE_WORKER_DISPATCH_MODE Add a WorkerDispatchMode option to AzureStorageOptions and map it onto AzureStorageOrchestrationServiceSettings, with precedence DURABLE_WORKER_DISPATCH_MODE env var > host.json > Both. Enables orchestrator-only / activity-only pods to share one host.json and select their role via a single per-deployment env var. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a46fedee-ae5e-41e9-af21-c79ce08d3b40
…h WorkerDispatchMode Temporary dev-loop shim pointing DurableTask.AzureStorage/Core at a locally-packed 9999.0.0-workerdispatch build carrying the unreleased WorkerDispatchMode API. Drop this commit and revert to released versions (AzureStorage 2.9.1 / Core 3.9.0) once that change ships to nuget.org. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: a46fedee-ae5e-41e9-af21-c79ce08d3b40
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds “worker dispatch mode” configuration to the Azure Storage durability provider plumbing, enabling a worker to dispatch orchestrator/entity work, activity work, or both—optionally overridden per-deployment via an environment variable.
Changes:
- Introduces
AzureStorageOptions.WorkerDispatchMode(defaultBoth) and wires it intoAzureStorageOrchestrationServiceSettings. - Adds precedence logic so
DURABLE_WORKER_DISPATCH_MODEoverrides host.json. - Adds unit tests for default/mapping/override/invalid environment variable behavior, and adds a temporary local NuGet feed + placeholder package versions for the unreleased upstream API.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/FunctionsV2/Tests/Unit/AzureStorageDurabilityProviderFactoryTests.cs | Adds unit tests covering WorkerDispatchMode defaulting, host.json mapping, env-var override, and invalid env-var values. |
| src/WebJobs.Extensions.DurableTask/Options/AzureStorageOptions.cs | Adds WorkerDispatchMode option with documentation describing env-var override precedence. |
| src/WebJobs.Extensions.DurableTask/AzureStorageDurabilityProviderFactory.cs | Plumbs WorkerDispatchMode into Azure Storage settings and adds env-var resolution logic. |
| nuget.config | Adds a repo-root local package source intended for an unreleased DurableTask change. |
| Directory.Packages.props | Pins DurableTask AzureStorage/Core to placeholder 9999.0.0-workerdispatch versions. |
| .gitignore | Ignores the repo-root local-packages/ folder used by the local feed. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+268
to
+272
| string envValue = this.nameResolver.Resolve(WorkerDispatchModeEnvironmentVariable); | ||
| if (string.IsNullOrWhiteSpace(envValue)) | ||
| { | ||
| return this.azureStorageOptions.WorkerDispatchMode; | ||
| } |
Comment on lines
+7
to
+10
| <!-- TEMPORARY dev-loop shim: local feed for the unreleased DurableTask WorkerDispatchMode change. | ||
| Remove this source (and revert the 9999.0.0-workerdispatch versions in Directory.Packages.props) | ||
| once Microsoft.Azure.DurableTask.AzureStorage with WorkerDispatchMode is published. --> | ||
| <add key="local-workerdispatch" value="local-packages" /> |
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
What changed?
DURABLE_WORKER_DISPATCH_MODEenv var or equivalent host.json valueWhy is this change needed?
Issues / work items
Project checklist
pending_docs.mdrelease_notes.mdWebJobs.Extensions.DurableTaskpackage/src/Worker.Extensions.DurableTask/AssemblyInfo.csEventSourcelogsv2.xbranchWebJobs.Extensions.DurableTaskv3.x and will be retained only in thedevandmainbranchesAI-assisted code disclosure (required)
Was an AI tool used? (select one)
If AI was used:
AI verification (required if AI was used):
Testing
Automated tests
Manual validation (only if runtime/behavior changed)
1.
2.
3.
Notes for reviewers