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

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

      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
      

          [JENKINS-28147] Xvfb not terminated when a Maven module rebuild fails inside a plugin

          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.

          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.

          Sean Flanigan added a comment -

          That's great, thanks!

          Sean Flanigan added a comment - That's great, thanks!

          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

          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

          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

          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

          zregvart added a comment -

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

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

          Sean Flanigan added a comment -

          Thanks, zregvart.

          Sean Flanigan added a comment - Thanks, zregvart .

          zregvart added a comment -

          Closing old issues

          zregvart added a comment - Closing old issues

          Fixed in 2.13

          Arnaud Héritier added a comment - Fixed in 2.13

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

              Created:
              Updated:
              Resolved: