-
Notifications
You must be signed in to change notification settings - Fork 13
feat: Add resilience features - retry, rate limiting, and timeouts #135
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
base: main
Are you sure you want to change the base?
feat: Add resilience features - retry, rate limiting, and timeouts #135
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
This pull request introduces a comprehensive set of resilience features to the Lighthouse SDK, significantly
improving its reliability and robustness in production environments. The key additions are automatic retries
with exponential backoff, configurable rate limiting, and request timeouts.
Summary of Changes
specific server-side issues (e.g., 5xx status codes, 429 rate limiting). This is handled by a new withRetry
utility that uses an exponential backoff strategy with jitter to prevent overwhelming the API.
to avoid hitting API rate limits.
indefinitely.
being resilient.
This is a draft pr and I will be awaiting for review to finalize testing.
PR closes #134
PR Type
Enhancement
Description
Add comprehensive resilience features with retry, rate limiting, and timeouts
Implement exponential backoff retry mechanism with configurable conditions
Create token bucket rate limiter for API request throttling
Replace standard fetch with resilient alternatives across SDK
Diagram Walkthrough
File Walkthrough
9 files
Replace fetch with resilientFetch for IPNS operations
Add resilient fetch with custom retry conditions
Replace fetchWithTimeout with resilientUpload for file uploads
Export resilience utilities and configuration presets
Implement token bucket rate limiter with burst capacity
Create resilient fetch wrapper with retry and timeout
Implement resilient upload with progress tracking support
Add exponential backoff retry mechanism with jitter
Export new resilience utilities from utils module
1 files
Create configuration presets for different API operation types