Repository navigation
Fix Batch bulk task retry race - #50881
Merged
Merged
Conversation
|
Azure Pipelines: Successfully started running 1 pipeline(s). 35 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
vcolin7
marked this pull request as ready for review
October 20, 2026 09:18
vcolin7
requested review from
a team,
David Watrous (dpwatrous),
iwang2,
Victor Li (lilinvictorms),
Sanjana Kapur (skapur12),
wiboris and
Xing Wu (xingwu1)
as code owners
October 20, 2026 09:18
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The focused change addresses the retry race, adds relevant regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Fixes premature completion of Batch bulk task creation when workers requeue tasks for retry.
Changes:
- Checks active workers before checking the pending queue.
- Strengthens retry assertions and adds repeated, multi-chunk, and exception-propagation tests.
- Updates the package and catalog current-version to 1.0.1 and documents the fix.
| File | Description |
|---|---|
| sdk/batch/azure-compute-batch/src/test/java/com/azure/compute/batch/TaskManagerTests.java | Expands retry and exception coverage. |
| sdk/batch/azure-compute-batch/src/main/java/com/azure/compute/batch/implementation/task/TaskManager.java | Reorders completion checks to prevent missed retries. |
| sdk/batch/azure-compute-batch/pom.xml | Sets package version to 1.0.1. |
| sdk/batch/azure-compute-batch/CHANGELOG.md | Documents the race-condition fix. |
| eng/versioning/version_client.txt | Aligns current-version while preserving dependency-version. |
Review effort: Balanced
Alan Zimmer (alzimmermsft)
approved these changes
Oct 21, 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.
Description
Fixes a race in Batch bulk task creation that could return success before retrying tasks with server errors.
TaskManager.createTasksnow checks active workers before the pending queue so it can't miss tasks requeued just before a worker releases its semaphore permit.Strengthens retry-count assertions and adds 1,000 repetitions of the single-server-error case, 100 repetitions of runtime exception propagation, checked-exception coverage, and 201-task retry cases at concurrency 1 and 4.
An example of the intermittent failure appeared in build 6963845, in
TaskManagerTests.successAfterOneServerErrorDidRetry, during validation of #50760. The fake submitter doesn't use Netty, and the race predates that PR. The original intermittent failure wasn't reproduced locally.Validation for
sdk\batch\azure-compute-batch:All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines
Written with the help or Copilot