Make Helix Job Monitor uploads restart-safe#17179
Open
mmitche wants to merge 3 commits into
Open
Conversation
Document the intended cancellation-first behavior and add representative invariant-to-test traceability.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: baa969a4-1d79-4b6a-a3f0-4d349d768b5e
Describe deduplication in terms of completed, tagged runs while preserving intentional replay of interrupted uploads.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: baa969a4-1d79-4b6a-a3f0-4d349d768b5e
Track upload lifecycle explicitly, retry only safe read operations, avoid replaying ambiguous writes, and keep incomplete runs untagged for later recovery.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>\nCopilot-Session: baa969a4-1d79-4b6a-a3f0-4d349d768b5e
This was referenced Jul 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens the Helix Job Monitor’s Azure DevOps test-result upload pipeline so it can be safely restarted after crashes/timeouts by separating durable completion (tagged runs) from queued/in-progress/failed uploads, and by bounding/targeting retries to avoid replaying ambiguous Azure DevOps writes.
Changes:
- Introduces explicit upload lifecycle state tracking (queued/in-progress/durably-completed/failed) and updates the runner/queue to honor durable completion tags.
- Adds transient-failure classification and bounded retries for safe (read-only) download operations while disabling retries for state-changing Azure DevOps operations.
- Expands unit coverage across runner, services, publisher, and fakes for restart-safety and transient/permanent failure behaviors.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/JobMonitorRunnerTests.cs | Adds/updates scenarios asserting restart-safe behavior and non-replay of ambiguous uploads/completions. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/HelixServiceTests.cs | Adds coverage for transient per-file download failures while still attempting the full batch. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/Fakes/FakeHelixService.cs | Adds queued transient download failure injection to simulate retries. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/Fakes/FakeAzureDevOpsService.cs | Adds create/complete failure injection and tracks complete call counts for new behaviors. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/AzureDevOpsServiceTests.cs | Verifies create/complete do not retry ambiguous writes. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/AzureDevOpsResultPublisherTests.cs | Adds tests for configurable retry behavior for ambiguous writes. |
| src/Microsoft.DotNet.Helix/JobMonitor/TransientFailureDetector.cs | New shared transient-failure classifier used by queue/services. |
| src/Microsoft.DotNet.Helix/JobMonitor/TestResultUploadQueue.cs | Splits upload into phases with bounded retries for safe operations and non-replay of ambiguous writes. |
| src/Microsoft.DotNet.Helix/JobMonitor/Services/HelixService.cs | Treats transient per-file failures as retryable after attempting remaining files; throws aggregated transient failure. |
| src/Microsoft.DotNet.Helix/JobMonitor/Services/AzureDevOpsService.cs | Disables adapter-level transient retries for create/complete/attachment writes; disables publisher write retries; improves HttpRequestException status propagation. |
| src/Microsoft.DotNet.Helix/JobMonitor/MonitorState.cs | Replaces “processed” set with explicit upload lifecycle state machine keyed by Helix job. |
| src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.Design.md | Updates behavioral spec to document restart-safe semantics and retry/non-replay rules. |
| src/Microsoft.DotNet.Helix/JobMonitor/JobMonitorRunner.cs | Avoids marking jobs as processed at queue time; prevents duplicate enqueue within an invocation via state. |
| src/Microsoft.DotNet.Helix/AzureDevOpsTestPublisher/Model/AzureDevOpsReportingParameters.cs | Adds RetryWrites parameter to control write retry behavior. |
| src/Microsoft.DotNet.Helix/AzureDevOpsTestPublisher/AzureDevOpsResultPublisher.cs | Implements configurable retry count based on request method / write-retry configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+552
to
+553
| internal static int GetRetryCount(HttpMethod method, bool retryWrites) | ||
| => retryWrites || method == HttpMethod.Get ? 10 : 0; |
mmitche
marked this pull request as ready for review
July 23, 2026 21:12
premun
approved these changes
Jul 27, 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.
Summary
Stacking
This PR is stacked on #17178. Until that PR merges, its two documentation commits appear in this PR as well; the implementation commit is
Make Job Monitor uploads restart-safe.Closes #17173
Parent epic: #17171