Skip to content

Add retry with exponential backoff for upload/download#220

Merged
AndreyVMarkelov merged 1 commit into
dropbox:masterfrom
AndreyVMarkelov:add-retry-logic
Jun 8, 2026
Merged

Add retry with exponential backoff for upload/download#220
AndreyVMarkelov merged 1 commit into
dropbox:masterfrom
AndreyVMarkelov:add-retry-logic

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Add retry with exponential backoff for transient errors on uploads and downloads.

  • Retry on server 500s, rate limits (with RetryAfter), network errors, unexpected EOF, and too_many_write_operations
  • Downloads write to atomic temp file (.name.tmp-PID-NANO) then rename — prevents corruption on retry or crash
  • Chunked uploads handle already-accepted chunks idempotently via incorrect_offset detection
  • Symlinks are preserved on download (temp file created alongside resolved target)
  • Single-shot uploads seek back to start before each retry attempt

Issues Fixed

Test Plan

  • Unit tests for retry logic (transient vs permanent errors, backoff timing, rate-limit RetryAfter)
  • Unit tests for atomic download (body read error retry, temp file cleanup, symlink preservation)
  • Unit tests for chunk idempotency (expected vs unexpected incorrect_offset)
  • Unit tests for too_many_write_operations retry (single-shot and session finish)
  • Manual test: upload + download + verify file integrity (including zip files)
  • go vet / go build clean

@CLAassistant

CLAassistant commented Jun 8, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Implement retry logic with exponential backoff for transient errors
(server 500s, rate limits, network errors, unexpected EOF, and
too_many_write_operations). Downloads write to an atomic temp file to
prevent corruption on retry or crash. Chunked uploads handle
already-accepted chunks idempotently. Symlinks are preserved on
download.

Closes dropbox#211, closes dropbox#185, closes dropbox#75, closes dropbox#149.
@AndreyVMarkelov AndreyVMarkelov merged commit 60fb550 into dropbox:master Jun 8, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants