Skip to content

Retry Drive's 409 Conflict on delete in filesystem - #473

Open
Siddanagowda wants to merge 3 commits into
iterative:mainfrom
Siddanagowda:retry-conflict-on-delete
Open

Siddanagowda wants to merge 3 commits into
iterative:mainfrom
Siddanagowda:retry-conflict-on-delete

Conversation

@Siddanagowda

Copy link
Copy Markdown

Summary

Fixes #465.

Google Drive may return HTTP 409 Conflict with reason conflict when a file is permanently deleted shortly after being updated or converted. The filesystem previously did not retry this response.

Changes

  • Added an opt-in conflict_errors parameter to the existing retry mechanism.
  • Retry HTTP 409 errors only when the reason is conflict.
  • Enabled conflict retries exclusively for permanent file deletion (DELETE).
  • Kept trash operations (PATCH) and unrelated Drive operations unchanged.
  • Preserved existing 404 handling, including treating a subsequent 404 after an earlier delete attempt as successful deletion.

Tests

Added regression tests covering:

  • Single and repeated 409 conflicts.
  • 409 followed by 404.
  • First-attempt 404.
  • Unrelated 409 (fileIdInUse) and 400 (badRequest) errors.
  • Trash operations without conflict retries.
  • Retry exhaustion.
  • Directory deletion and emptiness rechecking.
  • Existing 503 server-error retry behavior.

Verification

  • Focused regression tests: 10 passed.
  • Filesystem unit tests: 285 passed, 1 skipped.
  • Ruff lint: passed.
  • Ruff formatting: passed.
  • git diff --check: passed.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Filesystem doesn't retry Drive's 409 Conflict on delete

1 participant