Skip to content

JobMonitor: Include QueueId in submitter chain key so cross-queue work-item outcomes don't overwrite each other - #16938

Merged
premun merged 1 commit into
dotnet:mainfrom
premun:jobmonitor/fix-cross-queue-outcome-overwrite
Jun 2, 2026
Merged

premun merged 1 commit into
dotnet:mainfrom
premun:jobmonitor/fix-cross-queue-outcome-overwrite

Conversation

@premun

@premun premun commented Jun 2, 2026

Copy link
Copy Markdown
Member

A single AzDO matrix leg can fan out to multiple Helix queues, each producing its own Helix job under the same System.JobName. The previous submitter chain key was based on System.JobName only, so jobs from different queues collided in the work-item outcome dictionary — a later-arriving pass could overwrite an earlier failure (or vice versa) from a sibling queue.

This change combines System.JobName with the Helix QueueId when building the submitter chain key, so:

  • Resubmissions of the same AzDO job to the same queue still share the same key (retries overwrite prior outcomes correctly).
  • Sibling Helix jobs on different queues under the same AzDO job now stay distinct.

Includes a test that reproduces the cross-queue overwrite.

Split out of #16879.

Copilot AI review requested due to automatic review settings June 2, 2026 12:25

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

Fixes a bug in JobMonitorRunner where the submitter chain key — used to dedupe/roll up work-item outcomes across resubmissions — was based solely on the AzDO System.JobName. When a single AzDO matrix leg fanned out to multiple Helix queues, sibling Helix jobs collided on the same key, allowing a later pass to overwrite an earlier failure (or vice versa). The fix incorporates the Helix QueueId into the key so resubmissions to the same queue still share a key but sibling queues stay distinct.

Changes:

  • Combine SubmitterJobName with QueueId via new FormatSubmitterChainKey helper in GetSubmitterChainKey.
  • Update the XML doc comment to describe the new keying behavior.
  • Add regression test covering the multi-queue fan-out scenario.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.cs Include QueueId in submitter chain key; add formatter helper and update doc comment.
src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.cs New test reproducing cross-queue overwrite scenario, asserting non-zero exit.

@premun
premun enabled auto-merge (squash) June 2, 2026 13:27
@premun
premun merged commit 23cb1e4 into dotnet:main Jun 2, 2026
10 checks passed
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 11.0-preview6 milestone Jun 4, 2026
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.

3 participants