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

Pollscm trigger runs the job twice for the same commit

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Critical
    • Resolution: Unresolved
    • Component/s: core, pipeline
    • Labels:
      None
    • Environment:
      Jenkins 2.7.4
    • Similar Issues:

      Description

      We've got the job with pollscm trigger enabled for two repositories.
      The job is triggered twice with one minute interval, though both commit hashes are the same.

      Pollscm logs look like this:

      Started on Sep 22, 2016 9:47:00 AM
      Using strategy: Default
      [poll] Last Built Revision: Revision <revA> (go/master)
      ...
      [poll] Latest remote head revision on refs/heads/master is: <revA> - already built by 1
      Using strategy: Default
      ...
      [poll] Latest remote head revision on refs/heads/master is: <revB>
      Done. Took 1 sec
      Changes found
      
      Started on Sep 22, 2016 9:48:00 AM
      Using strategy: Default
      [poll] Last Built Revision: Revision <revA> (go/master)
      ...
      [poll] Latest remote head revision on refs/heads/master is: <revA> - already built by 2
      Using strategy: Default
      ...
      [poll] Latest remote head revision on refs/heads/master is: <revB>
      Done. Took 0.65 sec
      Changes found
      

      <revA, revB> pair is the same in two job runs.

        Attachments

          Issue Links

            Activity

            Hide
            sonneveldsmartward Nick Sonneveld added a comment - - edited

            When I had a pipeline job's PollSCM property configured with "@daily", I witnessed 7 builds triggered for the same changeset. All were "Started by an SCM change". Is it possible that PollSCM isn't checking for a running build with that changeset? Although why would it attempt to build more than once a day?

            Show
            sonneveldsmartward Nick Sonneveld added a comment - - edited When I had a pipeline job's PollSCM property configured with "@daily", I witnessed 7 builds triggered for the same changeset. All were "Started by an SCM change". Is it possible that PollSCM isn't checking for a running build with that changeset? Although why would it attempt to build more than once a day?
            Hide
            ifn Shat Shabaev added a comment -

            It seems that setting concurrent to false prevents from rerunning the job for the same commit.
            I'm not sure that it is connected with Pipeline plugin.

            Show
            ifn Shat Shabaev added a comment - It seems that setting concurrent to false prevents from rerunning the job for the same commit. I'm not sure that it is connected with Pipeline plugin.
            Hide
            danielbeck Daniel Beck added a comment -

            You're probably polling too often. Jenkins looks at past builds to determine what has already been built, and if there's not enough time to start a build and checkout from SCM to record what the current state is, Jenkins will just queue another build, as what has been found hasn't been built yet.

            Show
            danielbeck Daniel Beck added a comment - You're probably polling too often. Jenkins looks at past builds to determine what has already been built, and if there's not enough time to start a build and checkout from SCM to record what the current state is, Jenkins will just queue another build, as what has been found hasn't been built yet.
            Hide
            sonneveldsmartward Nick Sonneveld added a comment - - edited

            As far as I know, we're only polling "daily" per branch, configured via pollSCM. We do have a mercurial hook that GETs "/mercurial/notifyCommit" for each commit but I feel that shouldn't affect things as that is just notifying jenkins that "something" changed. The parent multibranch job does not have any polling configured.

            Show
            sonneveldsmartward Nick Sonneveld added a comment - - edited As far as I know, we're only polling "daily" per branch, configured via pollSCM. We do have a mercurial hook that GETs "/mercurial/notifyCommit" for each commit but I feel that shouldn't affect things as that is just notifying jenkins that "something" changed. The parent multibranch job does not have any polling configured.
            Hide
            ifn Shat Shabaev added a comment -

            Jenkins will just queue another build, as what has been found hasn't been built yet

            As far as I understand, queuing the job repeatedly for the same commit is ok. Strange though. Thanks.

            Show
            ifn Shat Shabaev added a comment - Jenkins will just queue another build, as what has been found hasn't been built yet As far as I understand, queuing the job repeatedly for the same commit is ok. Strange though. Thanks.
            Hide
            sonneveldsmartward Nick Sonneveld added a comment -

            Linking to related JENKINS-39092 . The difference is that no polling interval is set, only change notifications

            Show
            sonneveldsmartward Nick Sonneveld added a comment - Linking to related JENKINS-39092 . The difference is that no polling interval is set, only change notifications

              People

              • Assignee:
                Unassigned
                Reporter:
                ifn Shat Shabaev
              • Votes:
                5 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated: