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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Critical
    • Resolution: Fixed
    • Component/s: p4-plugin
    • Labels:
    • Environment:
      P4-Plugin 1.9.3
      Jenkins 2.138.1
    • Similar Issues:

      Description

      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.

       

       

        Attachments

          Issue Links

            Activity

            Hide
            alisdair_robertson Alisdair Robertson added a comment -

            Hey Karl Wirth, the only content under the branch job polling log for the last poll is as follows (workspace names changes, but they include node name job name and stage name):

            Started on 01/05/2019 8:16:00 PM
            P4: Polling on: master with:workspace-1-name
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            P4: Polling on: master with:workspace-2-name
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            P4: Polling on: master with:workspace-3-name
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            P4: Polling on: master with:workspace-4-name
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            P4: Polling on: master with:workspace-5-name
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            P4: Polling on: master with:workspace-6-name
            P4: Polling: No changes in previous build.
            P4: Polling error; no previous change.
            Done. Took 1.8 sec
            No changes

            I see normal polling output for the other branches of the multibranch pipeline where the most recent build was not a failure.

            This multibranch pipeline never automatically runs the 'scan multibranch pipeline' job, we only run that manually when we have new branches that need to be added. The Jenkinsfile configures explicit SCM polling once each evening.

            Show
            alisdair_robertson Alisdair Robertson added a comment - Hey Karl Wirth , the only content under the branch job polling log for the last poll is as follows (workspace names changes, but they include node name job name and stage name): Started on 01/05/2019 8:16:00 PM P4: Polling on: master with:workspace-1-name P4: Polling: No changes in previous build. P4: Polling error; no previous change. P4: Polling on: master with:workspace-2-name P4: Polling: No changes in previous build. P4: Polling error; no previous change. P4: Polling on: master with:workspace-3-name P4: Polling: No changes in previous build. P4: Polling error; no previous change. P4: Polling on: master with:workspace-4-name P4: Polling: No changes in previous build. P4: Polling error; no previous change. P4: Polling on: master with:workspace-5-name P4: Polling: No changes in previous build. P4: Polling error; no previous change. P4: Polling on: master with:workspace-6-name P4: Polling: No changes in previous build. P4: Polling error; no previous change. Done. Took 1.8 sec No changes I see normal polling output for the other branches of the multibranch pipeline where the most recent build was not a failure. This multibranch pipeline never automatically runs the 'scan multibranch pipeline' job, we only run that manually when we have new branches that need to be added. The Jenkinsfile configures explicit SCM polling once each evening.
            Hide
            feelingmimsy Dave Miller added a comment -

            I just upgraded to 1.10.0 to address a different issue, and I'm trying to understand why commit 283834eabea30f31cde59b1ab3b743a01b2f47cb, which claims to be associated with this ticket, is now throwing un-actionable "Severe warnings" when it finds duplicate SyncIDs. Why do duplicate syncIDs justify a severe log entry, what do they have to to with this ticket, and how should they be addressed? These "Severe warnings" are dramatically clogging our server logs. Paul Allen?

            Show
            feelingmimsy Dave Miller added a comment - I just upgraded to 1.10.0 to address a different issue, and I'm trying to understand why commit 283834eabea30f31cde59b1ab3b743a01b2f47cb, which claims to be associated with this ticket, is now throwing un-actionable "Severe warnings" when it finds duplicate SyncIDs. Why do duplicate syncIDs justify a severe log entry, what do they have to to with this ticket, and how should they be addressed? These "Severe warnings" are dramatically clogging our server logs.  Paul Allen ?
            Hide
            p4karl Karl Wirth added a comment -

            Hi Dave Miller - We have had a lot of polling problems recently. Some of them came down to problems in P4-Jenkins but many came down to customers using the same workspace with different views in the same job. For each sync we store a sync ID keyed on the workspace name and if there are two we could easily be syncing and building the wrong changelists or missing changelists. Therefore we decided to highlight this with the message you see.

            I'd like to investigate this further but will be asking for some potentially confidential information. Would you be willing to send an email to 'support@perforce.com' for my attention so that I can get this information from you?

            Show
            p4karl Karl Wirth added a comment - Hi Dave Miller - We have had a lot of polling problems recently. Some of them came down to problems in P4-Jenkins but many came down to customers using the same workspace with different views in the same job. For each sync we store a sync ID keyed on the workspace name and if there are two we could easily be syncing and building the wrong changelists or missing changelists. Therefore we decided to highlight this with the message you see. I'd like to investigate this further but will be asking for some potentially confidential information. Would you be willing to send an email to 'support@perforce.com' for my attention so that I can get this information from you?
            Hide
            p4karl Karl Wirth added a comment -

            Have created the following bug to document here what the 'duplicate syncID found' means and suggest a messaging improvement:

            JENKINS-58067

            Show
            p4karl Karl Wirth added a comment - Have created the following bug to document here what the 'duplicate syncID found' means and suggest a messaging improvement: JENKINS-58067
            Hide
            cbopardikar Charusheela Bopardikar added a comment -

            Released in 1.9.7

            Show
            cbopardikar Charusheela Bopardikar added a comment - Released in 1.9.7

              People

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

                Dates

                Created:
                Updated:
                Resolved: