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

Pipeline: If job fails it will run again on next poll.

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • p4-plugin
    • P4-Plugin 1.9.3
      Jenkins 2.138.1

      When a job detected by polling fails, it will run again the next time polling runs even when there are no new changes since last poll. For example.

      (1) Build works.
      (2) No new changes = Next poll no execution.
      (3) New change made = Next poll execution.
      (4) Build fails = Next poll execution.
      (5) Build fails = Next poll execution.
      (6) Build works = Next poll no execution.

       

      Reproductions steps:

      (1) Create a pipeline job with the following Jenkinsfile and set it up to poll every minutes (or use the PollNow plugin):

      pipeline {  agent { label 'master' }
        
        stages {
          stage("Run script") {
            steps {
              script {
              def failJob = input(message: 'Do you wish this job to work?', 
      	                ok: 'OK', 
                              parameters: [booleanParam(defaultValue: true, 
                              description: 'If you want this to fail untick yes and click YES',
                              name: 'Yes?')])	   
                 echo "Input Result:" + failJob
                 if (failJob == false)
                 {
                    sh 'Arghhhhh'
                 }
      	   echo "P4_CLIENT is:"
      	   echo env.P4_CLIENT
              }
            }
          }
        }
      }
      
      

      (2) Submit a changelist to the polled view.

      (3) Wait for job to run, go into the console for the job execution and click on 'Input requested', Untick 'Yes?' then click 'OK'. Job will be marked as 'FAILURE'.

      (4) Wait for next poll or click 'Poll Now'. Job will trigger again.

      (5) On 'Input requested just click 'OK'. Job will be marked as 'SUCCESS'.

      (6) Wait for next poll or click 'Poll Now'. Job will NOT trigger again.

       

       

          [JENKINS-55075] Pipeline: If job fails it will run again on next poll.

          Karl Wirth created issue -

          Karl Wirth added a comment -

          FYI - msmeeth, p4paul

          Karl Wirth added a comment - FYI - msmeeth , p4paul
          Karl Wirth made changes -
          Priority Original: Major [ 3 ] New: Critical [ 2 ]
          Karl Wirth made changes -
          Link New: This issue is duplicated by JENKINS-54076 [ JENKINS-54076 ]
          Karl Wirth made changes -
          Labels Original: P4_VERIFY New: P4_A
          Paul Allen made changes -
          Assignee New: Paul Allen [ p4paul ]

          Nancy Belser added a comment -

          We are experiencing this problem as well. We cannot execute builds so it is a critical problem.

          Nancy Belser added a comment - We are experiencing this problem as well. We cannot execute builds so it is a critical problem.

          Karl Wirth added a comment -

          Hi nbelser - Can you confirm what you mean by you cannot execute builds? Also what is the reason the builds are failling? Is it a transient infrastructure problem or bad code?

          Karl Wirth added a comment - Hi nbelser - Can you confirm what you mean by you cannot execute builds? Also what is the reason the builds are failling? Is it a transient infrastructure problem or bad code?

          Nancy Belser added a comment -

          Hi Karl,

          We had to shut down our jenkins instance because we cannot get the pipeline project to stop constantly polling perforce and attempting to build with no changes.

          Nancy Belser added a comment - Hi Karl, We had to shut down our jenkins instance because we cannot get the pipeline project to stop constantly polling perforce and attempting to build with no changes.

          Paul Allen added a comment -

          Hi Nancy,

          It seems that on Karl's system a bad syncID was causing the polling logic to think there were new changes.  Please can you recreate the Jenkins Job (e.g. create a new job and delete or disable the one continuously polling).

          If you have a support ticket open with Karl, please can you email a copy of your build.xml file for the last failing build and your config.xml.  We will review the data tomorrow and see if you were experiencing the same issue Karl had when upgrading from 1.9.3 -> 1.9.6

          Kind regards,

          Paul

          Paul Allen added a comment - Hi Nancy, It seems that on Karl's system a bad syncID was causing the polling logic to think there were new changes.  Please can you recreate the Jenkins Job (e.g. create a new job and delete or disable the one continuously polling). If you have a support ticket open with Karl, please can you email a copy of your build.xml file for the last failing build and your config.xml.  We will review the data tomorrow and see if you were experiencing the same issue Karl had when upgrading from 1.9.3 -> 1.9.6 Kind regards, Paul

            cbopardikar Charusheela Bopardikar
            p4karl Karl Wirth
            Votes:
            4 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: