Skip to content

Fix Batch bulk task retry race - #50881

Merged
Alan Zimmer (alzimmermsft) merged 2 commits into
mainfrom
vcolin7-batch-retry-race
Oct 21, 2026
Merged

Alan Zimmer (alzimmermsft) merged 2 commits into
mainfrom
vcolin7-batch-retry-race

Conversation

@vcolin7

@vcolin7 vcolin7 commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Description

Fixes a race in Batch bulk task creation that could return success before retrying tasks with server errors. TaskManager.createTasks now 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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Written with the help or Copilot

@github-actions github-actions Bot added the Batch label Oct 20, 2026
@azure-pipelines

Copy link
Copy Markdown
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
vcolin7 marked this pull request as ready for review October 20, 2026 09:18
Copilot AI balanced review requested due to automatic review settings October 20, 2026 09:18

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.

🟢 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

@alzimmermsft
Alan Zimmer (alzimmermsft) merged commit e321055 into main Oct 21, 2026
27 checks passed
@alzimmermsft
Alan Zimmer (alzimmermsft) deleted the vcolin7-batch-retry-race branch October 21, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants