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

Build is triggered incorrectly when a triggered build starts running

    Details

    • Similar Issues:

      Description

      if the buildresult is set to trigger with a schedule of every minute
      (* * * * ) and you have a long runnign upstream job, the job with a trigger will trigger when the upstream job **starts building*

      This appears to be due to a Null POinter Exception as the trigger gets the status of the LastBuild - but the lastBuild may be currently building and return a null status.

      see private boolean isMatchingExpectedResults(String jobName, CheckedResult[] expectedResults, XTriggerLog log) in src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java

      Polling started on Jul 25, 2013 2:47:53 PM
      Polling for the job cms-at_master-LEVEL-1
      Looking nodes where the poll can be run.
      Looking for a candidate node to run the poll.
      Trying to find an eligible node with the assigned project label RH53_ATC.
      
      Polling remotely on cabci-cf-rh53-x64-atc01
      Checking changes for job CMS/cms-subsystem/cms-subsystem/commit.
      There are no new builds for the job CMS/cms-subsystem/cms-subsystem/commit.
      Checking changes for job CMS/vcm/vcm-app/commit.
      There is at least one new build for the job CMS/vcm/vcm-app/commit. Checking expected job build results.
      Checking SUCCESS
      [ERROR] - Polling error...
      

      See also the output from the script console

      AbstractProject jobObj = Hudson.getInstance().getItemByFullName("CMS/vcm/vcm-app/commit/", AbstractProject.class);
      Run jobObjLastBuild = jobObj.getLastBuild();
      Result jobObjectLastResult = jobObjLastBuild.getResult();
      
      println("run: " + jobObjLastBuild.number);
      println("status: " + jobObjLastBuild.result);
      println("isBuilding: " + jobObjLastBuild.building);
      
      run: 1089
      status: null
      isBuilding: true
      

      The polling error then causes a build to be triggered which will trigger the build prematurely and when the build has finished the build will not be triggered.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: James Nord
          Path:
          src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java
          http://jenkins-ci.org/commit/buildresult-trigger-plugin/6aac32a245eae1c2800d88a17033ff70c2df2b7a
          Log:
          [FIXED JENKINS-18931] Build is triggered incorrectly when a triggered build starts running.

          Context should be calculated against a completed build not an in progress one.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: James Nord Path: src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java http://jenkins-ci.org/commit/buildresult-trigger-plugin/6aac32a245eae1c2800d88a17033ff70c2df2b7a Log: [FIXED JENKINS-18931] Build is triggered incorrectly when a triggered build starts running. Context should be calculated against a completed build not an in progress one.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Gregory Boissinot
          Path:
          src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java
          http://jenkins-ci.org/commit/buildresult-trigger-plugin/f3f5fab993d404e2b18f32e8af1f2ad35981f771
          Log:
          Merge pull request #6 from jtnord/JENKINS-18931

          Fixes Jenkins-18931

          Compare: https://github.com/jenkinsci/buildresult-trigger-plugin/compare/12f65d79ac7b...f3f5fab993d4

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Gregory Boissinot Path: src/main/java/org/jenkinsci/plugins/buildresulttrigger/BuildResultTrigger.java http://jenkins-ci.org/commit/buildresult-trigger-plugin/f3f5fab993d404e2b18f32e8af1f2ad35981f771 Log: Merge pull request #6 from jtnord/ JENKINS-18931 Fixes Jenkins-18931 Compare: https://github.com/jenkinsci/buildresult-trigger-plugin/compare/12f65d79ac7b...f3f5fab993d4

            People

            • Assignee:
              gbois Gregory Boissinot
              Reporter:
              teilo James Nord
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: