Skip to content
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

To many requests from pull requests plugin to BitBucket cloud hit rate limit #66

Open
jaczie opened this issue Jun 5, 2018 · 0 comments

Comments

@jaczie
Copy link

jaczie commented Jun 5, 2018

Hi,

I'm using pullrequests plugin with TeamCity 10 and BitBucket Cloud.
I get the following error in the logs:

05-Jun-2018 06:14:21.589 INFO [TC: 06:14:21 PullRequest Handler; 06:14:21 Task: "java.util.concurrent.FutureTask@5c1d9ca7"; Low prio executor 2] com.arcbees.pullrequest.PullRequestStatusHandler.handle Handling build status - Build Status: FINISHED, Branch: mip-uplift, isSuccessful: false
05-Jun-2018 06:14:21.735 SEVERE [TC: 06:14:21 PullRequest Handler; 06:14:21 Task: "java.util.concurrent.FutureTask@5c1d9ca7"; Low prio executor 2] com.arcbees.pullrequest.PullRequestsBuildListener$2.run Error updating pull request status.
com.arcbees.vcs.util.UnexpectedHttpStatusException: Failed to complete request. Status: HTTP/1.1 429 Unknown Status Code
Rate limit for this resource has been exceeded
at com.arcbees.vcs.AbstractVcsApi.doExecuteRequest(AbstractVcsApi.java:128)
at com.arcbees.vcs.AbstractVcsApi.processResponse(AbstractVcsApi.java:63)
at com.arcbees.vcs.bitbucket.BitbucketApi.getOpenedPullRequests(BitbucketApi.java:79)
at com.arcbees.vcs.bitbucket.BitbucketApi.getPullRequestForBranch(BitbucketApi.java:93)
at com.arcbees.pullrequest.PullRequestStatusHandler.handle(PullRequestStatusHandler.java:78)
at com.arcbees.pullrequest.PullRequestsBuildListener$2.run(PullRequestsBuildListener.java:87)
at jetbrains.buildServer.util.NamedThreadFactory.executeWithNewThreadName(NamedThreadFactory.java:71)
at jetbrains.buildServer.util.ExceptionUtil$1.run(ExceptionUtil.java:41)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

I get information from Bitbucket Team that the reason is we exceed rate limit (for pull requests is 1k per hour, per user).
How often plugin is performing checks to BB for new pull requests? Is it connected with TC "Default VCS changes check interval" settings?
We get also the following solution from BB: "what we can recommend to avoid hitting that limit is increase the pagelen with your API requests to 50 by using
"?pagelen=50" on the request. That way you get 5 times as much bandwidth as our default is set to 10 per page." Is it possible to use it?
What are your recomendation on that?

Thanks,
zz

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

No branches or pull requests

1 participant