Skip to content

fix(core): preserve temporary error semantics in BatchDeleter zero-success path#7402

Open
TennyZhuang wants to merge 1 commit intofix/batch-deleter-progress-trackingfrom
fix/batch-deleter-temporary-retry-semantics
Open

fix(core): preserve temporary error semantics in BatchDeleter zero-success path#7402
TennyZhuang wants to merge 1 commit intofix/batch-deleter-progress-trackingfrom
fix/batch-deleter-temporary-retry-semantics

Conversation

@TennyZhuang
Copy link
Copy Markdown
Contributor

@TennyZhuang TennyZhuang commented Apr 17, 2026

Which issue does this PR close?

N/A - Follow-up to #7401. Found through deterministic state machine testing of BatchDeleter.

Rationale

When delete_batch() returns zero successes but all individual failures are temporary errors, flush_buffer() returns a hardcoded permanent error:

return Err(Error::new(
    ErrorKind::Unexpected,
    "batch delete returned zero successes",
));

This kills retry semantics: callers (including retry layers) see a permanent error and give up, even though all underlying failures are temporary and could succeed on retry.

Changes

  • Modified flush_buffer() to check whether all failures in the zero-success case are temporary. If so, the returned error is marked temporary via set_temporary().
  • Added a regression test with a mock that returns all-temporary failures on the first call and all successes on retry, verifying that the error is correctly marked temporary.

Are there any user-facing changes?

Retry layers will now correctly retry batch delete operations when all individual failures are temporary, instead of treating them as permanent failures.


This change was generated with the assistance of an AI coding agent.

🤖 Generated with Claude Code

@TennyZhuang TennyZhuang requested a review from Xuanwo as a code owner April 17, 2026 08:42
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. releases-note/fix The PR fixes a bug or has a title that begins with "fix" labels Apr 17, 2026
…ccess path

When `delete_batch()` returns zero successes but all individual failures
are temporary errors, `flush_buffer()` now returns a temporary error
instead of a permanent one. Previously, the hardcoded permanent error
killed retry semantics, causing callers to give up on items that were
only temporarily failing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@TennyZhuang TennyZhuang force-pushed the fix/batch-deleter-temporary-retry-semantics branch from 43f378d to 344fab1 Compare April 17, 2026 08:49
@TennyZhuang TennyZhuang requested a review from tisonkun as a code owner April 17, 2026 08:49
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Apr 17, 2026
@TennyZhuang TennyZhuang changed the base branch from main to fix/batch-deleter-progress-tracking April 17, 2026 08:50
@dosubot dosubot Bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/fix The PR fixes a bug or has a title that begins with "fix" size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant