Skip to content

Add retry logic to S3 metadata#41

Merged
f0reachARR merged 1 commit intomainfrom
fix/storage-retry
Apr 27, 2026
Merged

Add retry logic to S3 metadata#41
f0reachARR merged 1 commit intomainfrom
fix/storage-retry

Conversation

@f0reachARR
Copy link
Copy Markdown
Member

…f S3 head object results.

@f0reachARR f0reachARR enabled auto-merge April 27, 2026 14:40
@f0reachARR f0reachARR merged commit ffd819e into main Apr 27, 2026
2 checks passed
@f0reachARR f0reachARR deleted the fix/storage-retry branch April 27, 2026 14:41
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the getObjectMetadata function in the storage service by implementing a retry mechanism to handle S3's eventual consistency and transient 404 errors. The changes include new utility functions for metadata validation and error handling, supported by updated unit tests. A review comment suggests adopting an exponential backoff strategy for the retry delay to optimize performance and resource usage.

}

if (attempt < maxAttempts) {
await wait(retryDelayMs);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Using a fixed retry delay can be inefficient or lead to unnecessary load during transient failures. Implementing an exponential backoff strategy is generally a best practice for retries, especially when dealing with eventual consistency in cloud services like S3.

Suggested change
await wait(retryDelayMs);
await wait(retryDelayMs * Math.pow(2, attempt - 1));

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.

1 participant