RFR: 1801: Exclude some GraphQL calls from RestRequestCache rate limiter
Erik Joelsson
erikj at openjdk.org
Tue Jan 24 14:45:43 UTC 2023
In [SKARA-1731](https://bugs.openjdk.org/browse/SKARA-1731), the best practices regarding non GET requests on Github became better enforced. Unfortunately that has lead to some unexpected performance issues. I believe this is mostly caused by GraphQL requests, which are always POST, being treated as a non GET REST requests by the limiter and limited to one per second. This limitation on a subset of our github queries is currently causing a queue buildup for that lock, which stabilizes to about 1m wait time. This delay is slowing down response times from the bots massively.
Reading the Integrator best practices document again (https://docs.github.com/en/rest/guides/best-practices-for-integrators?apiVersion=2022-11-28) and the GraphQL resource limitations (https://docs.github.com/en/graphql/overview/resource-limitations) I'm pretty sure you aren't supposed to limit GraphQL to one call per second, but rather just make sure you stay within the points limit. The one per second recommendation is for the REST API.
I want to make it possible to exclude certain calls from this rate limiter to see if this can alleviate the contention we are currently seeing. I have run with this patch for the pr bot since yesterday afternoon (PT) and it seems to be working well.
Two PRs were unable to integrate yesterday due to this contention:
https://github.com/openjdk/jdk/pull/12139
https://github.com/openjdk/jdk/pull/11922
-------------
Commit messages:
- SKARA-1801
Changes: https://git.openjdk.org/skara/pull/1461/files
Webrev: https://webrevs.openjdk.org/?repo=skara&pr=1461&range=00
Issue: https://bugs.openjdk.org/browse/SKARA-1801
Stats: 19 lines in 4 files changed: 10 ins; 0 del; 9 mod
Patch: https://git.openjdk.org/skara/pull/1461.diff
Fetch: git fetch https://git.openjdk.org/skara pull/1461/head:pull/1461
PR: https://git.openjdk.org/skara/pull/1461
More information about the skara-dev
mailing list