Skip to content

Microsoft durable worker dispatch mode plumbing - #3466

Draft
Steven (stevenhvtran) wants to merge 2 commits into
Azure:devfrom
stevenhvtran:transteven-microsoft-durable-worker-dispatch-mode-plumbing
Draft

Microsoft durable worker dispatch mode plumbing#3466
Steven (stevenhvtran) wants to merge 2 commits into
Azure:devfrom
stevenhvtran:transteven-microsoft-durable-worker-dispatch-mode-plumbing

Conversation

@stevenhvtran

@stevenhvtran Steven (stevenhvtran) commented Jul 20, 2026

Copy link
Copy Markdown

Summary

What changed?

Why is this change needed?

  • Enables users to selectively have worker pools serve just orchestrator or activity jobs. Prevents noisy neighbour scenarios wherein the partition limited (Azure Storage Backend) orchestrator workers may waste compute on activities.

Issues / work items

  • Resolves #
  • Related #

Project checklist

  • Documentation changes are not required
    • Otherwise: Documentation PR is ready to merge and referenced in pending_docs.md
  • Release notes are not required for the next release
    • Otherwise: Notes added to release_notes.md
  • Backport is not required
    • Otherwise: Backport tracked by issue/PR #issue_or_pr
  • All required tests have been added/updated (unit tests, E2E tests)
  • No extra work is required to be leveraged by OutOfProc SDKs
    • Otherwise: Work tracked here: #issue_or_pr_in_each_sdk
  • No change to the version of the WebJobs.Extensions.DurableTask package
    • Otherwise: Major/minor updates are reflected in /src/Worker.Extensions.DurableTask/AssemblyInfo.cs
  • No EventIds were added to EventSource logs
  • This change should be added to the v2.x branch
    • Otherwise: This change applies exclusively to WebJobs.Extensions.DurableTask v3.x and will be retained only in the dev and main branches
  • Breaking change?
    • If yes:
      • Impact:
      • Migration guidance:

AI-assisted code disclosure (required)

Was an AI tool used? (select one)

  • No
  • Yes, AI helped write parts of this PR (e.g., GitHub Copilot)
  • Yes, an AI agent generated most of this PR

If AI was used:

  • Tool(s): Copilot
  • AI-assisted areas/files:
  • What you changed after AI output:

AI verification (required if AI was used):

  • I understand the code and can explain it
  • I verified referenced APIs/types exist and are correct
  • I reviewed edge cases/failure paths (timeouts, retries, cancellation, exceptions)
  • I reviewed concurrency/async behavior
  • I checked for unintended breaking or behavior changes

Testing

Automated tests

  • Result: Passed / Failed (link logs if failed)

Manual validation (only if runtime/behavior changed)

  • Environment (OS, .NET version, components):
  • Steps + observed results:
    1.
    2.
    3.
  • Evidence (optional):

Notes for reviewers

  • N/A

Steven Tran and others added 2 commits July 20, 2026 11:22
…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
Copilot AI review requested due to automatic review settings July 20, 2026 01:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (default Both) and wires it into AzureStorageOrchestrationServiceSettings.
  • Adds precedence logic so DURABLE_WORKER_DISPATCH_MODE overrides 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 thread nuget.config
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" />
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.

2 participants