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

incremental builds leave modules unbuilt upon failure

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Component/s: maven-plugin
    • Labels:
      None

      Description

      We're using maven + hudson + java. I kicked off a build which resulted in a failure in a module. This left several modules unbuilt, even though they did not depend on the failed module. I kicked off a new build, however, the previously unbuilt modules were still not rebuilt. Please let me know if you need more information.

        Issue Links

          Activity

          Hide
          mindless Alan Harder added a comment -

          config of your job and console logs from these builds would help.. or steps to reproduce the issue in a new install of a recent hudson release.

          Show
          mindless Alan Harder added a comment - config of your job and console logs from these builds would help.. or steps to reproduce the issue in a new install of a recent hudson release.
          Hide
          kutzi kutzi added a comment -

          I think the behaviour was fixed, so that unstable/failing modules are alway rebuild.
          Can you retest with a current version of Hudson?

          Show
          kutzi kutzi added a comment - I think the behaviour was fixed, so that unstable/failing modules are alway rebuild. Can you retest with a current version of Hudson?
          Hide
          banoss banoss added a comment - - edited

          I'm testing with 1.387.

          If there are, say, 3 modules and modules 1 & 3 need to be built. If module 1 fails and is subsequently fixed. Module 3 will never be built.

          Because module 3 was never built originally - due to module 1 failure - its then missed from subsequent incremental builds.

          Pretty basic to set up a test with one parent POM with say 3 modules.

          Show
          banoss banoss added a comment - - edited I'm testing with 1.387. If there are, say, 3 modules and modules 1 & 3 need to be built. If module 1 fails and is subsequently fixed. Module 3 will never be built. Because module 3 was never built originally - due to module 1 failure - its then missed from subsequent incremental builds. Pretty basic to set up a test with one parent POM with say 3 modules.
          Hide
          kutzi kutzi added a comment -

          Idea:

          • when a build fails, store all modules which weren't build because of that in an Action attached to the build
          • on the next incremental build retrieve these modules from the Actions of a previously failed builds and add them to the build list
          Show
          kutzi kutzi added a comment - Idea: when a build fails, store all modules which weren't build because of that in an Action attached to the build on the next incremental build retrieve these modules from the Actions of a previously failed builds and add them to the build list
          Hide
          kutzi kutzi added a comment -

          This depends on the behaviour in JENKINS-9072 that modules which needn't be build, are set tho NOT_BUILD in the early stages of the aggregator build.

          Show
          kutzi kutzi added a comment - This depends on the behaviour in JENKINS-9072 that modules which needn't be build, are set tho NOT_BUILD in the early stages of the aggregator build.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java
          http://jenkins-ci.org/commit/jenkins/f4233876cdab86c7d19ecf3fcd8f0c530d39117f
          Log:
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt
          upon failure

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java http://jenkins-ci.org/commit/jenkins/f4233876cdab86c7d19ecf3fcd8f0c530d39117f Log: [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt upon failure
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/27871ce1df3cebdcffd3e2992c21c92a8696df75
          Log:
          record changes for JENKINS-5764 and JENKINS-9072

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/27871ce1df3cebdcffd3e2992c21c92a8696df75 Log: record changes for JENKINS-5764 and JENKINS-9072
          Hide
          dogfood dogfood added a comment -

          Integrated in jenkins_main_trunk #622
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt

          Christoph Kutzinski : f4233876cdab86c7d19ecf3fcd8f0c530d39117f
          Files :

          • maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java
          • maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          Show
          dogfood dogfood added a comment - Integrated in jenkins_main_trunk #622 [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt Christoph Kutzinski : f4233876cdab86c7d19ecf3fcd8f0c530d39117f Files : maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          Hide
          banoss banoss added a comment -

          Thanks for this one kutzi!

          I've run some tests which is now working fine for the scenario above and it does remember beyond 1 build

          This problem still exists if there is a POM parsing problem - I suspect this is because the build has not properly kicked off by this time. This scenario still requires a full build to be forced. I'll play some more.

          Show
          banoss banoss added a comment - Thanks for this one kutzi! I've run some tests which is now working fine for the scenario above and it does remember beyond 1 build This problem still exists if there is a POM parsing problem - I suspect this is because the build has not properly kicked off by this time. This scenario still requires a full build to be forced. I'll play some more.
          Hide
          kutzi kutzi added a comment -

          You're welcome.

          Could you do me a favour and create a new issue for the POM parsing problem?

          Show
          kutzi kutzi added a comment - You're welcome. Could you do me a favour and create a new issue for the POM parsing problem?
          Hide
          paux Stephan Pauxberger added a comment -

          Shouldn't the next build include not only modules that weren't built, but ALL modules of the failed build? Else Jenkins' PostBuild deploy action would not work (see JENKINS-5121):

          Given A -> B -> C

          A has changes, A, B and C are built, failure during build of B
          changes in B (to correct the previous problem) : B and C are built and deployed. Or worse, B fails because its changes depend on previous changes from A
          Changes from A a never deployed, resulting in an inconsistent repository.

          If the second build would include ALL modules of failed build 1, the problem would disappear.

          This solution would be way faster to implement than trying to preserve artifacts from previous builds.

          Show
          paux Stephan Pauxberger added a comment - Shouldn't the next build include not only modules that weren't built, but ALL modules of the failed build? Else Jenkins' PostBuild deploy action would not work (see JENKINS-5121 ): Given A -> B -> C A has changes, A, B and C are built, failure during build of B changes in B (to correct the previous problem) : B and C are built and deployed. Or worse, B fails because its changes depend on previous changes from A Changes from A a never deployed, resulting in an inconsistent repository. If the second build would include ALL modules of failed build 1, the problem would disappear. This solution would be way faster to implement than trying to preserve artifacts from previous builds.
          Hide
          banoss banoss added a comment -

          I agree, don't want to start flaffing about with artefacts...

          Well, the worst case is this grows to a full build, which is a small price to pay for a consistent set of artefacts which is the goal and reason for using the post-build deploy task. I'd be happy with this.

          If your choosing not to use the post-build task and rely on "clean deploy" then you are OK with the current fix (deploy as you go) as you want fast incrementals and fast fixes I would guess. You are taking artefacts at risk. Again I'd be happy with this trade off.

          There is a question here whether to change the behaviour based on the job option?

          Show
          banoss banoss added a comment - I agree, don't want to start flaffing about with artefacts... Well, the worst case is this grows to a full build, which is a small price to pay for a consistent set of artefacts which is the goal and reason for using the post-build deploy task. I'd be happy with this. If your choosing not to use the post-build task and rely on "clean deploy" then you are OK with the current fix (deploy as you go) as you want fast incrementals and fast fixes I would guess. You are taking artefacts at risk. Again I'd be happy with this trade off. There is a question here whether to change the behaviour based on the job option?
          Hide
          kutzi kutzi added a comment - - edited

          Actually, I wanted to disagree first, but then I thought that you're right. Deploy action might be handled as a special case, but there are possibly many more after-build actions which we don't know about. So just building all the same modules again - plus any with new SCM changes - might be the safest way to handle that.

          But unfortunately it's not easier to implemented that - not least because I've already implemented the other way.

          Show
          kutzi kutzi added a comment - - edited Actually, I wanted to disagree first, but then I thought that you're right. Deploy action might be handled as a special case, but there are possibly many more after-build actions which we don't know about. So just building all the same modules again - plus any with new SCM changes - might be the safest way to handle that. But unfortunately it's not easier to implemented that - not least because I've already implemented the other way.
          Hide
          kutzi kutzi added a comment - - edited

          Closing this again as 'this' bug as per original description is fixed.
          The issue with the deployment of artifacts is JENKINS-5121

          Show
          kutzi kutzi added a comment - - edited Closing this again as 'this' bug as per original description is fixed. The issue with the deployment of artifacts is JENKINS-5121
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenBuild.java
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java
          http://jenkins-ci.org/commit/jenkins/f4233876cdab86c7d19ecf3fcd8f0c530d39117f
          Log:
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt
          upon failure

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: maven-plugin/src/main/java/hudson/maven/MavenBuild.java maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java maven-plugin/src/main/java/hudson/maven/UnbuiltModuleAction.java http://jenkins-ci.org/commit/jenkins/f4233876cdab86c7d19ecf3fcd8f0c530d39117f Log: [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt upon failure
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/27871ce1df3cebdcffd3e2992c21c92a8696df75
          Log:
          record changes for JENKINS-5764 and JENKINS-9072

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: changelog.html http://jenkins-ci.org/commit/jenkins/27871ce1df3cebdcffd3e2992c21c92a8696df75 Log: record changes for JENKINS-5764 and JENKINS-9072
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Christoph Kutzinski
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          src/main/java/hudson/maven/UnbuiltModuleAction.java
          http://jenkins-ci.org/commit/maven-plugin/3faaa85e4804cdb7e5462960b036f1fd9276d018
          Log:
          [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt
          upon failure
          Originally-Committed-As: f4233876cdab86c7d19ecf3fcd8f0c530d39117f

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Christoph Kutzinski Path: src/main/java/hudson/maven/MavenBuild.java src/main/java/hudson/maven/MavenModuleSetBuild.java src/main/java/hudson/maven/UnbuiltModuleAction.java http://jenkins-ci.org/commit/maven-plugin/3faaa85e4804cdb7e5462960b036f1fd9276d018 Log: [FIXED JENKINS-5764] maven incremental builds leave modules unbuilt upon failure Originally-Committed-As: f4233876cdab86c7d19ecf3fcd8f0c530d39117f

            People

            • Assignee:
              kutzi kutzi
              Reporter:
              matthewnewhook matthewnewhook
            • Votes:
              2 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: