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

PollSCM runs again when job on commit takes longer then the trigger

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • git-plugin, pipeline
    • None
    • Jenkins 2.125, Ubuntu 14

      When the pollSCM in a declarative pipeline is executed when the jobs on the same commit is queued and did not do a checkout scm the jobs is queued again on the same commit.

      A test Jekninsfile:

      pipeline {
          agent {
              node {
                  label 'local'
              }
          }
          triggers {
              pollSCM('H/2 * * * *')
          }
          stages {
              stage('Run') {
                  steps {
                      checkout scm
                      sh 'sleep 1000'
                  }
              }
          }
      }
      

      If a new commit is pushed within in 1000 seconds and the executors on jenkins are busy jenkins will fire a new job at each pollSCM till 1 job on this commit did do a checkout. In this example this will be 5-6 jobs on the same commit.

      When doing this on multiple repositories on a limited number of executors this will explode in 10000+ jobs if your unlucky. (happened to me)

            Unassigned Unassigned
            pjvanthof Peter Hof
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: