-
Notifications
You must be signed in to change notification settings - Fork 18
fix: reduced the number of retries #902
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
Conversation
WalkthroughA single configuration value in the initial config object was reduced from 10 to 3 for the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsErrors were encountered while retrieving linked issues. Errors (1)
Comment |
954e60a to
10aa4cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Jira integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
src/blocks/Config/initialConfig.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: build
| secureExpire: '', | ||
| secureDeliveryProxy: '', | ||
| retryThrottledRequestMaxTimes: 10, | ||
| retryThrottledRequestMaxTimes: 3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's confirm the actual content of the file and surrounding context
cat -n src/blocks/Config/initialConfig.ts | head -60Repository: uploadcare/file-uploader
Length of output: 2229
🏁 Script executed:
# Search for any references to retryThrottledRequestMaxTimes in the codebase
rg "retryThrottledRequestMaxTimes" -n -B 2 -A 2Repository: uploadcare/file-uploader
Length of output: 1593
🏁 Script executed:
# Look for any related issues or discussions in the codebase
rg "retry.*throttle" -i -n
rg "throttle.*retry" -i -nRepository: uploadcare/file-uploader
Length of output: 850
🏁 Script executed:
# Check if there are any tests related to this configuration
fd "\.test\.|\.spec\." -t f | xargs rg -l "retryThrottledRequestMaxTimes" 2>/dev/null || echo "No test files found"Repository: uploadcare/file-uploader
Length of output: 87
🌐 Web query:
Uploadcare API rate limiting retry policies best practices
💡 Result:
Here are concise best-practice recommendations for handling Uploadcare API rate limiting and retries.
Key Uploadcare-specific items
- Honor 429 responses and any Retry-After header returned by Uploadcare. [1]
- Use Uploadcare’s multipart-upload options to control retries: set retryNetworkErrorMaxTimes and retryThrottledRequestMaxTimes when calling multipartStart. [2]
- Limit maxConcurrentRequests and choose an appropriate multipartChunkSize to reduce throttle risk. [2]
Retry strategy (recommended)
- On 429 or transient 5xx: stop immediate retries, then use exponential backoff with jitter (e.g., base 500–1000 ms, double each try, add random +/- up to 100–500 ms). Cap max delay (e.g., 30s–60s) and total retries (e.g., 3–8 attempts). [3]
- If Retry-After is present, delay at least that long before the next attempt (override exponential backoff for that request). [1][3]
- Only retry idempotent operations (GET, HEAD, PUT with idempotency keys); avoid blind retries for non-idempotent requests unless you implement server-side idempotency keys. [3]
Client design and operational practices
- Throttle outgoing concurrency at the client (global rate limiter) so aggregate calls stay under expected limits. [2][3]
- Prefer webhooks or server-side events instead of polling to reduce request volume. [2]
- Cache stable responses and batch requests where the API supports it. [3]
- Instrument logging & metrics (request counts, 429 rates, Retry-After values) and surface requestId/response details when contacting Uploadcare support. [1][3]
- Gracefully surface upload progress and retry states to users (cancel/abort options for long uploads). [2]
Implementation checklist (short)
- Read and respect Uploadcare 429/Retry-After behavior. [1]
- Configure multipartStart retry options and concurrency. [2]
- Implement exponential backoff + jitter, cap retries, obey Retry-After. [1][3]
- Use idempotency or avoid retrying unsafe operations. [3]
- Add metrics, logging, and fallbacks (webhooks, caching). [2][3]
Sources
- Uploadcare API reference (Upload API — 429/throttling notes). [1]
- Uploadcare blog: multipart uploads, retryNetworkErrorMaxTimes and retryThrottledRequestMaxTimes, concurrency controls. [2]
- General retry/backoff and rate-limit best practices (exponential backoff + jitter, honoring Retry-After, idempotency). [3]
Ensure the changelog and PR description document this revert from the previous 10-retry limit.
The value of 3 retries aligns with best practices for handling throttled requests (recommended range is 3–8 per Uploadcare and industry standards). This appears to be reverting the increase to 10 from issue #800, which confirms this is an intentional adjustment based on operational experience rather than an arbitrary change. The consistency with retryNetworkErrorMaxTimes: 3 is appropriate.
Verify that the CHANGELOG entry is updated to document this revert (e.g., referencing the prior increase from #800) and that the PR description explains the rationale.
🤖 Prompt for AI Agents
In src/blocks/Config/initialConfig.ts around line 49, the
retryThrottledRequestMaxTimes value was reverted to 3 from the previous 10;
update the CHANGELOG and the PR description to document this revert, explicitly
reference the prior increase from issue #800, and explain the operational
rationale (aligning with Uploadcare/industry guidance and consistency with
retryNetworkErrorMaxTimes: 3); ensure the PR description and changelog entry
mention the change, the issue number, and the reasoning for lowering retries to
3.
Description
Checklist
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.