Disable rate_limit check on GitHub Enterprise completely
See original GitHub issueGitHub Enterprise prior to 2.10 does not have rate limiting, requests to https://hostname/api/v3/rate_limit
will return a 404 Not Found status code. in 2.10+ rate limiting can be enabled, but is disabled by default.
Based on the change in #78 there is a check for rate_limit
, and then the rate limit is set to an arbitrary high number. On very busy systems this results in tens of thousands of requests per hour to the GitHub Enterprise appliance. Although returning a 404 is a relatively simple operation, there are other things such as logging that are impacted by the volume of requests.
~~A better method would be to look for /api/v3/ within the configured API URL, and then simply skip the rate limit check altogether. /api/v3/ is unique to GitHub Enterprise, so this will not have any impact on the GitHub.com rate_limit endpoint of https://api.github.com/rate_limit~~
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
The check I am referring to is here:
https://github.com/kohsuke/github-api/blob/a9fb4546e19e453766a46256c43232ed2ea35e6a/src/main/java/org/kohsuke/github/GitHub.java#L258-L274
Each
return retrieve().to("/rate_limit", JsonRateLimit.class).rate;
is a request to the GitHub Enterprise instance, which returns 404. This works sure, but on busy Jenkins systems this accounts for a huge number of extra requests, which still needs to be processed (consuming CPU), and fills up logs with noise, etc.Let me know if I can provide any further information.
I’m afraid I’ve seen this behaviour too in one of my jenkins instances:
I’ve just fixed by upgrading:
The above http 401/404 errors are not prompting when restarting Jenkins often but every 1/2 minutes