• Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • None
    • Jenkins ver. 2.138.1
      Bitbucket Branch Source Plugin 2.2.12

      For a while our branching indexing took a while to finish and now I decided to look into why. The console output isn't very helpful so I had to stumble into a rather random log message from com.cloudbees.jenkins.plugins.bitbucket.client.BitbucketCloudApiClient. It says:

      "Bitbucket Cloud API rate limit reached, sleeping for 5 sec then retry..."

      So I figured this was the issue. If I put in a new user, the indexing is fast for some time, then it slows down and the log messages reappear so this sort of confirms my suspicion. 

      We have a repo with ~300 branches that is periodically scanned every 5 minutes. 

      I looked at the rates at https://confluence.atlassian.com/bitbucket/rate-limits-668173227.html - Only three categories are limited to 1000 per hour but to me neither of them looks like it would limit checking of branch SHA's.

      Can somebody verify whether or not the branching is using the optimal calls to get branch SHA's?

      I have tried to see if I could figure out which HTTP(S) requests are used but I can't find anything useful in the logs.

       

          [JENKINS-54983] Hitting Bitbucket API Rate limit quite easily

          A potential fix has just been released (kindly provided by scddev) - could you please check if your issue is resolved by this as well?

          Günter Grodotzki added a comment - A potential fix has just been released (kindly provided by scddev ) - could you please check if your issue is resolved by this as well?

          Nikolas Falco added a comment -

          We had implemented a exponential backoff retry for cloud client. Anyway the issue here is the configuration

          We have a repo with ~300 branches that is periodically scanned every 5 minutes.

          Each scan requires a get all branch (paged) and than for each branch get the Jenkinsfile (assuming bitbucket cache feature is not enabled).
          In the linked documentation the limit is 1000 (till 10000 max also if not specified in which case). You Configured that each 5 minutes a repo scan is fired, it's clear than the limit is reached quickly.

          Nikolas Falco added a comment - We had implemented a exponential backoff retry for cloud client. Anyway the issue here is the configuration We have a repo with ~300 branches that is periodically scanned every 5 minutes. Each scan requires a get all branch (paged) and than for each branch get the Jenkinsfile (assuming bitbucket cache feature is not enabled). In the linked documentation the limit is 1000 (till 10000 max also if not specified in which case). You Configured that each 5 minutes a repo scan is fired, it's clear than the limit is reached quickly.

            Unassigned Unassigned
            mathiasi Mathias Immerkær
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: