Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement a retry mechanism for the FileUploader #2244

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

sfauvel
Copy link
Collaborator

@sfauvel sfauvel commented Jan 24, 2025

Content

Extend the FileUploader trait to support a retry mechanism.

This PR includes:

  • FileUploader trait extension to support a retry mechanism with a blanket implementation.
  • Implement a configurable retry for FileUploaderimplementation
  • Configure all file uploaders of the CardanoDatabase with the default retry values (3 retries and 5 seconds delay)

✋ Is it 3 retries or 3 attempts ?
new function is not used anymore for GcpUploader and LocalUploader. Should we remove them or add the retry policy and remove with_retry_policy ?

Pre-submit checklist

  • Branch
    • Tests are provided (if possible)
    • Crates versions are updated (if relevant)
    • CHANGELOG file is updated (if relevant)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested
  • Documentation
    • Update README file (if relevant)
    • Update documentation website (if relevant)
    • Add dev blog post (if relevant)

Issue(s)

Closes #2213

@@ -1,23 +1,35 @@
use anyhow::anyhow;
use async_trait::async_trait;
use mithril_common::{entities::FileUri, StdResult};
use std::{path::Path, sync::RwLock};
use std::{path::Path, sync::RwLock, time::Duration};

Check warning

Code scanning / clippy

unused import: time::Duration Warning

unused import: time::Duration
Copy link

Test Results

    4 files  ±0     52 suites  ±0   10m 29s ⏱️ +22s
1 553 tests +8  1 553 ✅ +8  0 💤 ±0  0 ❌ ±0 
1 809 runs  +8  1 809 ✅ +8  0 💤 ±0  0 ❌ ±0 

Results for commit a5b6e20. ± Comparison against base commit 693d95a.

@sfauvel sfauvel marked this pull request as ready for review January 24, 2025 17:32
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.

Implement a retry mechanism for the FileUploader
1 participant