Skip to content

Block our expensive endpoints if our GitHub rate limits are too low#2445

Merged
Urgau merged 1 commit into
rust-lang:masterfrom
Urgau:block-when-too-low-gh-rate-limits
Jun 24, 2026
Merged

Block our expensive endpoints if our GitHub rate limits are too low#2445
Urgau merged 1 commit into
rust-lang:masterfrom
Urgau:block-when-too-low-gh-rate-limits

Conversation

@Urgau

@Urgau Urgau commented Jun 23, 2026

Copy link
Copy Markdown
Member

Following up #triagebot > graphql rate-limit exhausted and #2443.

Let's block our exposed (and expensive) endpoints if our GitHub rate limits are too low (< 750 for either core or graphql), in order to keep our core functionalities (webhooks, github commands, ...) working.

Fetching GitHub /rate_limit:

does not count against your primary rate limit, but it can count against your secondary rate limit.

(If we are worried about the secondary rate limits, we could try to cache the headers, but that's much more complicated.)

cc @Mark-Simulacrum

@Urgau Urgau requested a review from Kobzol June 23, 2026 18:59

@Mark-Simulacrum Mark-Simulacrum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think the more general solution here would be to use two different tokens for these modes of operation... but that would take some infra work (e.g., spinning up separate GitHub apps). It does seem like a good idea long term though.

View changes since this review

Comment thread src/main.rs Outdated
@Urgau Urgau force-pushed the block-when-too-low-gh-rate-limits branch from c75092e to f4e8e94 Compare June 24, 2026 05:36
@Urgau

Urgau commented Jun 24, 2026

Copy link
Copy Markdown
Member Author

Yeah, using a second (or multiple) GitHub app(s) would fundamentally separate those issues, but has you said it would take some infra work.

So for now, let's rate limit before GitHub rate limit us.

@Urgau Urgau added this pull request to the merge queue Jun 24, 2026
Merged via the queue into rust-lang:master with commit 9823412 Jun 24, 2026
3 checks passed
@Urgau Urgau deleted the block-when-too-low-gh-rate-limits branch June 24, 2026 05:51
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.

2 participants