Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-47077

"Periodically if not otherwise run" interval does not trigger index scan

    • 6.7

      I have set up a multibranch pipeline with Bitbucket Cloud repository.
      I am running jenkins locally, so I am not using webhooks.

      I've set "Periodically if not otherwise run" interval to 2 minutes, but repository is not being scanned for changes. Scanning can only be triggered manualy by "Scan Multibranch pipeline now".

      I've tried to set this up from blue ocean, then from old UI and no luck in both.
      Also using regular Git branch source instead of Bitbucket doesn't work.

      So I guess the problem is with multibranch pipeline itself.

          [JENKINS-47077] "Periodically if not otherwise run" interval does not trigger index scan

          Wojciech Rak created issue -

          Does it work for 5 minutes?

          (Aside: Keep in mind that such aggressive scanning will get you rate limited by Bitbucket Cloud, so you probably want to set up webhook notification)

          If it works for 5 minutes but not for 2 then that could well be a bug in the cloudbees-folders plugin.

          Stephen Connolly added a comment - Does it work for 5 minutes? (Aside: Keep in mind that such aggressive scanning will get you rate limited by Bitbucket Cloud, so you probably want to set up webhook notification) If it works for 5 minutes but not for 2 then that could well be a bug in the cloudbees-folders plugin.
          Stephen Connolly made changes -
          Component/s New: cloudbees-folder-plugin [ 18137 ]
          Component/s Original: workflow-multibranch-plugin [ 21465 ]

          Wojciech Rak added a comment -

          I've tried also with 5 and 10 minutes, neither works for me.
          Scan Multibranch Pipeline Log is not being updated, shows only information from last scan.

          Can you tell me more about rate limit? Isn't this just fetching refs?

          If this scanning is so aggressive, is there any other setting to just fetch known branches? All I really want to achieve, is automated build of master branch after commit. It should be possible to do without webhooks, I guess.

          Wojciech Rak added a comment - I've tried also with 5 and 10 minutes, neither works for me. Scan Multibranch Pipeline Log is not being updated, shows only information from last scan. Can you tell me more about rate limit? Isn't this just fetching refs? If this scanning is so aggressive, is there any other setting to just fetch known branches? All I really want to achieve, is automated build of master branch after commit. It should be possible to do without webhooks, I guess.
          Stephen Connolly made changes -
          Attachment New: 1min.gif [ 39896 ]

          So I just tried on my own server,

          And as you can see the periodically runs, the initial scan was 9:32 and then when I check again it runs at 9:34... and then again at 9:36

          now there is a bug, if I recall correctly, where the 1 minute interval gets checked against 60 seconds and hence will almost always be 60 seconds since last check and so only every other minute will it run... but if I understand correctly that should only apply to the 1 minute interval and not affect the larger intervals (it's due to the cron tasks running once per minute)

          But the tasks are running for me.

          I'd check your master to see if something is blocking either the Jenkins cron thread or one of the jenkins.util.Timer threads.

          Additionally, there is a limit of 5 concurrent indexing/scanning tasks: https://github.com/jenkinsci/cloudbees-folder-plugin/blob/master/src/main/java/com/cloudbees/hudson/plugins/folder/computed/ThrottleComputationQueueTaskDispatcher.java#L49 so if you have other jobs that are say indexing GitHub and they have hit the GitHub rate limit, your indexing may just be blocked waiting for those to complete

          Stephen Connolly added a comment - So I just tried on my own server, And as you can see the periodically runs, the initial scan was 9:32 and then when I check again it runs at 9:34... and then again at 9:36 now there is a bug, if I recall correctly, where the 1 minute interval gets checked against 60 seconds and hence will almost always be 60 seconds since last check and so only every other minute will it run... but if I understand correctly that should only apply to the 1 minute interval and not affect the larger intervals (it's due to the cron tasks running once per minute) But the tasks are running for me. I'd check your master to see if something is blocking either the Jenkins cron thread or one of the jenkins.util.Timer threads. Additionally, there is a limit of 5 concurrent indexing/scanning tasks: https://github.com/jenkinsci/cloudbees-folder-plugin/blob/master/src/main/java/com/cloudbees/hudson/plugins/folder/computed/ThrottleComputationQueueTaskDispatcher.java#L49 so if you have other jobs that are say indexing GitHub and they have hit the GitHub rate limit, your indexing may just be blocked waiting for those to complete
          Wojciech Rak made changes -
          Attachment New: Screen Shot 2017-09-29 at 19.39.46.png [ 39902 ]
          Wojciech Rak made changes -
          Attachment New: Screen Shot 2017-09-29 at 19.37.09.png [ 39903 ]

          Wojciech Rak added a comment - - edited

          I did manage to get the schedule somehow working on Jenkins 2.60.3 on docker image.

          However it's running every ~12 minutes, despite being set to 5 minute interval.

           

           

          I also have 2.79 on my mac and as docker image, and the schedule isn't working on either of them.

           

          UPDATE

          With 2 minute interval, indexing is done every 3 minutes.

          Wojciech Rak added a comment - - edited I did manage to get the schedule somehow working on Jenkins 2.60.3 on docker image. However it's running every ~12 minutes, despite being set to 5 minute interval.     I also have 2.79 on my mac and as docker image, and the schedule isn't working on either of them.   UPDATE With 2 minute interval, indexing is done every 3 minutes.
          Wojciech Rak made changes -
          Attachment New: Screen Shot 2017-09-29 at 20.00.24.png [ 39904 ]

            stephenconnolly Stephen Connolly
            wojciechrak Wojciech Rak
            Votes:
            9 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved: