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

            ifn Shat Shabaev created issue -
            ifn Shat Shabaev made changes -
            Field Original Value New Value
            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:
            {code}
            Started on Sep 22, 2016 9:47:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision d6c60d0141c778107af732cf0dd051223c00be73 (go/master)
            using GIT_SSH to set credentials
             > git ls-remote -h git@gitlab.corp.mail.ru:rb/go.git # timeout=10
            Found 74 remote heads on git@gitlab.corp.mail.ru:rb/go.git
            [poll] Latest remote head revision on refs/heads/master is: d6c60d0141c778107af732cf0dd051223c00be73 - already built by 1
            Using strategy: Default
            using GIT_SSH to set credentials
             > git ls-remote -h git@gitlab.corp.mail.ru:rb/rb-autochecks.git # timeout=10
            Found 14 remote heads on git@gitlab.corp.mail.ru:rb/rb-autochecks.git
            [poll] Latest remote head revision on refs/heads/master is: 8b766797b64bcb34953f3aa70ca0161c3434bdc2
            Done. Took 1 sec
            Changes found
            {code}


            {code}
            Started on Sep 22, 2016 9:48:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision d6c60d0141c778107af732cf0dd051223c00be73 (go/master)
            using GIT_SSH to set credentials
             > git ls-remote -h git@gitlab.corp.mail.ru:rb/go.git # timeout=10
            Found 74 remote heads on git@gitlab.corp.mail.ru:rb/go.git
            [poll] Latest remote head revision on refs/heads/master is: d6c60d0141c778107af732cf0dd051223c00be73 - already built by 2
            Using strategy: Default
            using GIT_SSH to set credentials
             > git ls-remote -h git@gitlab.corp.mail.ru:rb/rb-autochecks.git # timeout=10
            Found 14 remote heads on git@gitlab.corp.mail.ru:rb/rb-autochecks.git
            [poll] Latest remote head revision on refs/heads/master is: 8b766797b64bcb34953f3aa70ca0161c3434bdc2
            Done. Took 0.65 sec
            Changes found
            {code}
            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:
            {code}
            Started on Sep 22, 2016 9:47:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision d6c60d0141c778107af732cf0dd051223c00be73 (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: d6c60d0141c778107af732cf0dd051223c00be73 - already built by 1
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: 8b766797b64bcb34953f3aa70ca0161c3434bdc2
            Done. Took 1 sec
            Changes found
            {code}


            {code}
            Started on Sep 22, 2016 9:48:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision d6c60d0141c778107af732cf0dd051223c00be73 (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: d6c60d0141c778107af732cf0dd051223c00be73 - already built by 2
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: 8b766797b64bcb34953f3aa70ca0161c3434bdc2
            Done. Took 0.65 sec
            Changes found
            {code}
            ifn Shat Shabaev made changes -
            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:
            {code}
            Started on Sep 22, 2016 9:47:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision d6c60d0141c778107af732cf0dd051223c00be73 (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: d6c60d0141c778107af732cf0dd051223c00be73 - already built by 1
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: 8b766797b64bcb34953f3aa70ca0161c3434bdc2
            Done. Took 1 sec
            Changes found
            {code}


            {code}
            Started on Sep 22, 2016 9:48:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision d6c60d0141c778107af732cf0dd051223c00be73 (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: d6c60d0141c778107af732cf0dd051223c00be73 - already built by 2
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: 8b766797b64bcb34953f3aa70ca0161c3434bdc2
            Done. Took 0.65 sec
            Changes found
            {code}
            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:
            {code}
            Started on Sep 22, 2016 9:47:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision <revX> (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revX> - already built by 1
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revY>
            Done. Took 1 sec
            Changes found
            {code}


            {code}
            Started on Sep 22, 2016 9:48:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision <revX> (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revX> - already built by 2
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revY>
            Done. Took 0.65 sec
            Changes found
            {code}
            ifn Shat Shabaev made changes -
            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:
            {code}
            Started on Sep 22, 2016 9:47:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision <revX> (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revX> - already built by 1
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revY>
            Done. Took 1 sec
            Changes found
            {code}


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


            {code}
            Started on Sep 22, 2016 9:48:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision <revX> (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revX> - already built by 2
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revY>
            Done. Took 0.65 sec
            Changes found
            {code}
            ifn Shat Shabaev made changes -
            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:
            {code}
            Started on Sep 22, 2016 9:47:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision <revX> (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revX> - already built by 1
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revY>
            Done. Took 1 sec
            Changes found
            {code}


            {code}
            Started on Sep 22, 2016 9:48:00 AM
            Using strategy: Default
            [poll] Last Built Revision: Revision <revX> (go/master)
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revX> - already built by 2
            Using strategy: Default
            ...
            [poll] Latest remote head revision on refs/heads/master is: <revY>
            Done. Took 0.65 sec
            Changes found
            {code}
            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:
            {code}
            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
            {code}


            {code}
            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
            {code}
            ifn Shat Shabaev made changes -
            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:
            {code}
            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
            {code}


            {code}
            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
            {code}
            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:
            {code}
            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
            {code}


            {code}
            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
            {code}

            <revA, revB> pair is the same between two job runs.
            ifn Shat Shabaev made changes -
            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:
            {code}
            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
            {code}


            {code}
            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
            {code}

            <revA, revB> pair is the same between two job runs.
            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:
            {code}
            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
            {code}


            {code}
            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
            {code}

            <revA, revB> pair is the same in two job runs.
            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?
            sonneveldsmartward Nick Sonneveld made changes -
            Component/s pipeline [ 21692 ]
            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.
            danielbeck Daniel Beck made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Not A Defect [ 7 ]
            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.
            sonneveldsmartward Nick Sonneveld made changes -
            Resolution Not A Defect [ 7 ]
            Status Resolved [ 5 ] Reopened [ 4 ]
            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
            sonneveldsmartward Nick Sonneveld made changes -
            Link This issue is related to JENKINS-39092 [ JENKINS-39092 ]
            pjvanthof Peter Hof made changes -
            Priority Major [ 3 ] Critical [ 2 ]
            pjvanthof Peter Hof made changes -
            Environment Jenkins 2.7.4 Jenkins 2.7.4, 2.120
            pjvanthof Peter Hof made changes -
            Environment Jenkins 2.7.4, 2.120 Jenkins 2.7.4

              People

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

                Dates

                • Created:
                  Updated: