Skip to content

feat: Add support to enable backoff when rate limited by the Github API #6644

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

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

Conversation

andrewhibbert
Copy link
Contributor

@andrewhibbert andrewhibbert commented Mar 24, 2025

Adds support to backoff when a rate limit error occurs as per handle rate limit errors appropriately:

  • If the retry-after response header is present, you should not retry your request until after that many seconds has elapsed.
  • If the x-ratelimit-remaining header is 0, you should not make another request until after the time specified by the x-ratelimit-reset header. The x-ratelimit-reset header is in UTC epoch seconds.
  • [N/A]When introducing a new scaler, I agree with the scaling governance policy
  • I have verified that my change is according to the deprecations & breaking changes policy
  • Tests have been added
  • Changelog has been updated and is aligned with our changelog requirements
  • [N/A] A PR is opened to update our Helm chart (repo) (if applicable, ie. when deployment manifests are modified)
  • A PR is opened to update the documentation on (repo) (if applicable)
  • Commits are signed with Developer Certificate of Origin (DCO - learn more)

Fixes #6643

Relates to kedacore/keda-docs#1557

@andrewhibbert andrewhibbert requested a review from a team as a code owner March 24, 2025 16:39
@andrewhibbert andrewhibbert changed the title Implement backoff when receive rate limit errors feat: Add support to enable backoff when rate limited by the Github API Mar 24, 2025
Copy link
Member

@zroubalik zroubalik left a comment

Choose a reason for hiding this comment

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

This is great addition, I wonder whether we should try to add this capabilities to all scalers that use HTTP client to optain metrics?

WDYT @kedacore/keda-maintainers

@zroubalik
Copy link
Member

zroubalik commented Mar 26, 2025

/run-e2e github
Update: You can check the progress here

@andrewhibbert
Copy link
Contributor Author

Hey, just wandering if there is any update on this?

@JorTurFer
Copy link
Member

I think that this is nice but I'm worried about if the waiting time is so long, as it'll look as an issue in KEDA (nothing will happen) when it's a desired behaviour

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

Nice improvement! Just a minor nit inline

@andrewhibbert andrewhibbert requested a review from zroubalik June 10, 2025 11:49
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 backoff when receive rate limit errors in the Github scaler
3 participants