Retry only transient Helix failures in Job Monitor - #17591
Merged
Merged
Conversation
Classify generated REST API failures by status code and return deterministic client errors immediately instead of retrying them five times. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, targeted, and includes new tests that directly validate the updated transient classification and retry behavior.
Pull request overview
This PR refines Helix Job Monitor retry behavior to avoid retry amplification by retrying only failures classified as transient, including generated Helix REST client exceptions classified by HTTP status code.
Changes:
- Stop retries early for non-transient failures in
HelixService.RetryAsyncby consultingTransientFailureDetector. - Extend transient classification to include
RestApiExceptionusing the HTTP response status code. - Add focused unit tests covering
RestApiExceptionstatus classification and verifying non-transient failures are not retried.
File summaries
| File | Description |
|---|---|
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/TransientFailureDetectorTests.cs | Adds unit coverage for transient classification of generated REST API exceptions by status code. |
| src/Microsoft.DotNet.Helix/Sdk.Tests/Microsoft.DotNet.Helix.Sdk.Tests/HelixServiceTests.cs | Adds a regression test ensuring non-transient failures are not retried. |
| src/Microsoft.DotNet.Helix/JobMonitor/TransientFailureDetector.cs | Adds RestApiException handling to transient detection based on HTTP status. |
| src/Microsoft.DotNet.Helix/JobMonitor/Services/HelixService.cs | Updates retry loop to retry only when failures are classified as transient. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
akoeplinger
approved these changes
Sep 19, 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
RestApiExceptionfailures using HTTP status codesAddresses the retry-amplification defect observed in dotnet/arcade#17502 and dnceng work item 12784. The prior implementation retried every exception five times, including invalid cancellation requests.
Validation
git diff --checkpasses.dotnetbecause the active sandbox denied file creation; PR validation should run the full tests