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

Workspaces mixed when launching multiple concurrent builds

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • maven-plugin
    • None
    • Linux 3.0.0-12-server #20-Ubuntu SMP Fri Oct 7 16:36:30 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux, Jenkins 1.440

      We are using gerrit with jenkins and launching three different jobs for every patchset. When multiple patchsets are uploaded, concurrent jobs are launched. We are using one master and one slave, and sometimes the workspaces get mixed up.

      From the build log of the job running on master which had a job #857:

      Building on master
      Checkout:workspace / /var/lib/jenkins/jobs/project/workspace - hudson.remoting.LocalChannel@bdbd63f
      Parsing POMs
      Failed to transfer Specified destination directory cannot be created: /home/jenkins-slave1/slave/workspace/project/.repository/org/jboss/arquillian/arquillian-bom/1.0.0.CR5

      From the build log of the job running on slave which had a job #858 which was launched at the same time (might not be related, though):
      Building remotely on slave1
      Checkout:RequesteX_UI_Tests / /home/jenkins-slave1/slave/workspace/project - hudson.remoting.Channel@6a77718e:slave1
      Using strategy: Gerrit Trigger
      Last Built Revision: Revision 22efd28a79038b66dc840bcd1617d26c6bf3cee2 (refs/changes/09/609/1)
      Checkout:RequesteX_UI_Tests / /home/jenkins-slave1/slave/workspace/project - hudson.remoting.LocalChannel@4dce6d48

      So the master is trying to use workspace on slave.
      I'm not completely sure, but I think that this happens only when jobs are running on different nodes and the jobs are launched at the same time, and the failing job is on the master node.
      Full log from master is attached.

          [JENKINS-11825] Workspaces mixed when launching multiple concurrent builds

          This happens on slave too, slave tries to write into workspace on master.

          Jyrki Puttonen added a comment - This happens on slave too, slave tries to write into workspace on master.

          While trying to find out what is happening, I think that the hudson.maven.MavenModuleSetBuild:1096 is the reason for this.

          this.workspaceProper = project.getLastBuild().getWorkspace().getRemote();

          As it seems that when two jobs are started simultaneously, the first one get the workspace of the latter one (#857 got from #858). I'll try to figure out what is happening exactly, but if someone can say directly how to fix that, just go ahead.

          Jyrki Puttonen added a comment - While trying to find out what is happening, I think that the hudson.maven.MavenModuleSetBuild:1096 is the reason for this. this.workspaceProper = project.getLastBuild().getWorkspace().getRemote(); As it seems that when two jobs are started simultaneously, the first one get the workspace of the latter one (#857 got from #858). I'll try to figure out what is happening exactly, but if someone can say directly how to fix that, just go ahead.

          I have a potential fix for this, https://github.com/jyrkiput/jenkins/commit/142a7bb9a479b8456a97f3ddabe65277db4643a9 and I'll put up a pull request after little testing

          Jyrki Puttonen added a comment - I have a potential fix for this, https://github.com/jyrkiput/jenkins/commit/142a7bb9a479b8456a97f3ddabe65277db4643a9 and I'll put up a pull request after little testing

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/jenkins/334ff7c921287f9dcf3f632453d406d8ecdd5c87
          Log:
          Merge pull request #318 from jyrkiput/master

          Fix for JENKINS-11825
          Thanks

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/jenkins/334ff7c921287f9dcf3f632453d406d8ecdd5c87 Log: Merge pull request #318 from jyrkiput/master Fix for JENKINS-11825 Thanks

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/ebc59a7ae6d5ca3ea6f492ab9bd98edda63344a5
          Log:
          change log entry for FIXED JENKINS-11825

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: changelog.html http://jenkins-ci.org/commit/jenkins/ebc59a7ae6d5ca3ea6f492ab9bd98edda63344a5 Log: change log entry for FIXED JENKINS-11825

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1318
          [FIXED JENKINS-11825] Use workspace from AbstractBuild
          change log entry for FIXED JENKINS-11825

          Jyrki Puttonen : 142a7bb9a479b8456a97f3ddabe65277db4643a9
          Files :

          • maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java

          Olivier Lamy : ebc59a7ae6d5ca3ea6f492ab9bd98edda63344a5
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #1318 [FIXED JENKINS-11825] Use workspace from AbstractBuild change log entry for FIXED JENKINS-11825 Jyrki Puttonen : 142a7bb9a479b8456a97f3ddabe65277db4643a9 Files : maven-plugin/src/main/java/hudson/maven/MavenModuleSetBuild.java Olivier Lamy : ebc59a7ae6d5ca3ea6f492ab9bd98edda63344a5 Files : changelog.html

          Jyrki Puttonen added a comment - Merged https://github.com/jenkinsci/jenkins/commit/334ff7c921287f9dcf3f632453d406d8ecdd5c87

          Code changed in jenkins
          User: Jyrki Puttonen
          Path:
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/maven-plugin/619af64c9817d827ecc94da7d959bf6530a2e04a
          Log:
          [FIXED JENKINS-11825] Use workspace from AbstractBuild

          Originally-Committed-As: 142a7bb9a479b8456a97f3ddabe65277db4643a9

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jyrki Puttonen Path: src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/619af64c9817d827ecc94da7d959bf6530a2e04a Log: [FIXED JENKINS-11825] Use workspace from AbstractBuild Originally-Committed-As: 142a7bb9a479b8456a97f3ddabe65277db4643a9

          Code changed in jenkins
          User: Olivier Lamy
          Path:
          src/main/java/hudson/maven/MavenModuleSetBuild.java
          http://jenkins-ci.org/commit/maven-plugin/eb1b1ed608a07cb90edd65cda3b8c484a3e30ff7
          Log:
          Merge pull request #318 from jyrkiput/master

          Fix for JENKINS-11825
          Thanks
          Originally-Committed-As: 334ff7c921287f9dcf3f632453d406d8ecdd5c87

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Olivier Lamy Path: src/main/java/hudson/maven/MavenModuleSetBuild.java http://jenkins-ci.org/commit/maven-plugin/eb1b1ed608a07cb90edd65cda3b8c484a3e30ff7 Log: Merge pull request #318 from jyrkiput/master Fix for JENKINS-11825 Thanks Originally-Committed-As: 334ff7c921287f9dcf3f632453d406d8ecdd5c87

            jyrki Jyrki Puttonen
            jyrki Jyrki Puttonen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: