fix(usage-metrics): reduce rate-limit cascade errors#3622
fix(usage-metrics): reduce rate-limit cascade errors#3622mdelapenya merged 2 commits intotestcontainers:mainfrom
Conversation
✅ Deploy Preview for testcontainers-go ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Summary by CodeRabbit
WalkthroughIntroduced rate-limit-specific detection and cooldown in the metrics collector: added Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What does this PR do?
When a GitHub Code Search API call fails with a rate-limit error (403/429) within a pass, the next query now waits 65 seconds instead of the default 7 seconds, giving the rolling rate-limit window time to reset before continuing.
Extracts a dedicated
isRateLimitErrorhelper to distinguish rate-limit errors from other transient HTTP errors (500/502/503), so only actual rate-limit hits trigger the longer cooldown.Why is it important?
Reduce rate-limit cascades in the usage-metrics collection workflow: after a 429, the next query fired just 7 seconds later, still inside the rate-limit window, causing it to also fail. With the in-pass cooldown, the collector can recover mid-pass instead of deferring all remaining failures to the next pass.
Related issues