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

Xvfb not terminated when a Maven module rebuild fails inside a plugin

    Details

    • Similar Issues:

      Description

      When rebuilding a single module of a multi-module project, I have an environment script which happens to fail (because $WORKSPACE is different from a normal top-level build, but any failure should do). When this environment script fails, the job naturally fails too, but the Xvfb plugin fails to terminate the Xvfb process it started, leading to problems in subsequent builds.

      I'm having trouble coming up with an easy minimal reproducer, because I think it only happens when a multi-module build is involved. I suspect the failure has to happen in a Jenkins plugin (like Environment Script) too: a normal build failure is not enough.

      This is the log from the rebuild which failed:

       
      Building remotely on jenkins-slave-f20-kvm-7 (amd64-Fedora 20 amd64-Fedora-20 Fedora-20 Fedora kvm amd64) in workspace /home/fedora/jenkins/workspace/zanata-server-github-pull-requests/functional-test
      Xvfb starting$ Xvfb :1 -screen 0 1024x768x24 -fbdir /home/fedora/jenkins/xvfb-2015-04-28_11-25-15-3566362744314223079.fbdir
      [functional-test] $ /bin/sh -xe /tmp/org.zanata:functional-test6279959920485140886.sh
      + etc/scripts/allocate-jboss-ports
      /tmp/org.zanata:functional-test6279959920485140886.sh: line 1: etc/scripts/allocate-jboss-ports: No such file or directory
      FATAL: Unable to execute script, return code 1
      Started calculate disk usage of build
      Finished Calculation of disk usage of build in 0 seconds
      Started calculate disk usage of workspace
      Finished Calculation of disk usage of workspace in 0 seconds
      Finished: FAILURE
      

        Attachments

          Activity

          Hide
          zregvart zregvart added a comment -

          Hi, thanks for reporting the issue and excuse me for not getting back sooner.
          I've managed to reproduce the issue and traced it down to an issue within the Maven job type in Jenkins. The Xvfb plugin is not notified of the failure of the Script environment plugin, and is not aware that the build failed so that it could terminate the started Xvfb process.
          I've created a pull request against the Jenkins Maven plugin (see https://github.com/jenkinsci/maven-plugin/pull/42).
          I'll monitor the updates of the pull request and close this issue if it gets merged and released.

          Show
          zregvart zregvart added a comment - Hi, thanks for reporting the issue and excuse me for not getting back sooner. I've managed to reproduce the issue and traced it down to an issue within the Maven job type in Jenkins. The Xvfb plugin is not notified of the failure of the Script environment plugin, and is not aware that the build failed so that it could terminate the started Xvfb process. I've created a pull request against the Jenkins Maven plugin (see https://github.com/jenkinsci/maven-plugin/pull/42 ). I'll monitor the updates of the pull request and close this issue if it gets merged and released.
          Hide
          seanf Sean Flanigan added a comment -

          That's great, thanks!

          Show
          seanf Sean Flanigan added a comment - That's great, thanks!
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Zoran Regvart
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          src/test/java/hudson/maven/MavenBuildTest.java
          http://jenkins-ci.org/commit/maven-plugin/8cec5cd889457e1d78aed033788d1b8872435d89
          Log:
          JENKINS-28147 Perform Environment tearDown if BuildWrapper signals error

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Zoran Regvart Path: src/main/java/hudson/maven/MavenBuild.java src/test/java/hudson/maven/MavenBuildTest.java http://jenkins-ci.org/commit/maven-plugin/8cec5cd889457e1d78aed033788d1b8872435d89 Log: JENKINS-28147 Perform Environment tearDown if BuildWrapper signals error
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: zregvart
          Path:
          src/main/java/hudson/maven/MavenBuild.java
          src/test/java/hudson/maven/MavenBuildTest.java
          http://jenkins-ci.org/commit/maven-plugin/f3f1f1123a727958b59ea3a731f9cae77b94ab0f
          Log:
          Merge pull request #42 from zregvart/master

          JENKINS-28147 Perform Environment tearDown if BuildWrapper fails

          Compare: https://github.com/jenkinsci/maven-plugin/compare/fbafb4d68218...f3f1f1123a72

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: zregvart Path: src/main/java/hudson/maven/MavenBuild.java src/test/java/hudson/maven/MavenBuildTest.java http://jenkins-ci.org/commit/maven-plugin/f3f1f1123a727958b59ea3a731f9cae77b94ab0f Log: Merge pull request #42 from zregvart/master JENKINS-28147 Perform Environment tearDown if BuildWrapper fails Compare: https://github.com/jenkinsci/maven-plugin/compare/fbafb4d68218...f3f1f1123a72
          Hide
          zregvart zregvart added a comment -

          The pull request was merged against the maven plugin, it should be fixed with the release of version 2.13.

          Show
          zregvart zregvart added a comment - The pull request was merged against the maven plugin, it should be fixed with the release of version 2.13.
          Hide
          seanf Sean Flanigan added a comment -

          Thanks, zregvart.

          Show
          seanf Sean Flanigan added a comment - Thanks, zregvart .
          Hide
          zregvart zregvart added a comment -

          Closing old issues

          Show
          zregvart zregvart added a comment - Closing old issues
          Hide
          aheritier Arnaud HĂ©ritier added a comment -

          Fixed in 2.13

          Show
          aheritier Arnaud HĂ©ritier added a comment - Fixed in 2.13

            People

            • Assignee:
              zregvart zregvart
              Reporter:
              seanf Sean Flanigan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: