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

Interaction between Perforce plugin and Matrix builds

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: perforce-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      If I'm using the Perforce plugin and have a setting for this project
      (FPHibernate-Head) with a workspace like this:
      Single Workspace: wyliek.hudson-clients.fphibernate-head.london
      View: //fotech/shared/lib/java/FPHibernate/head/...
      Hudson Home: /scratch/betasx2/wyliek/hudson-home

      And am using a configuration matrix of jdk1.6.0_03 and jdk1.5.0_13, what seems
      to happen is this:
      1) Perforce plugin does a sync to
      /scratch/betasx2/wyliek/hudson-home/jobs/FPHibernate-Head/workspace
      2) Matrix runner creates axis directory of
      /scratch/betasx2/wyliek/hudson-home/jobs/FPHibernate-Head/workspace/jdk/jdk1.5.0_13
      3) Perforce Plugin changes the root of the workspace to
      /scratch/betasx2/wyliek/hudson-home/jobs/FPHibernate-Head/workspace/jdk/jdk1.5.0_13
      and does a p4 sync. P4 says nothing to sync, but there's nothing there.
      4) Ant doesn't find the build.xml file to run.

      Here's the output on the overall project running:
      started
      Performing sync with Perforce for: //fotech/shared/lib/java/FPHibernate/head/...
      Changing P4 Client Root to:
      /scratch/betasx2/wyliek/hudson-home/jobs/FPHibernate-Head/workspace/
      Changing P4 Client View to: //fotech/shared/lib/java/FPHibernate/head/...
      //wyliek.hudson-clients.fphibernate-head.london/...
      Last sync'd change: 76672
      Sync'ing workspace to depot.
      ForceSync flag is set, forcing: p4 sync
      //fotech/shared/lib/java/FPHibernate/head/...
      Sync complete, took 3392 MS
      Triggering jdk=jdk1.6.0_03
      Triggering jdk=jdk1.5.0_13
      finished: FAILURE

      Here's the output on the jdk1.6.0_03 axis run:
      started
      Performing sync with Perforce for: //fotech/shared/lib/java/FPHibernate/head/...
      Changing P4 Client Root to:
      /scratch/betasx2/wyliek/hudson-home/jobs/FPHibernate-Head/workspace/jdk/jdk1.6.0_03/
      Changing P4 Client View to: //fotech/shared/lib/java/FPHibernate/head/...
      //wyliek.hudson-clients.fphibernate-head.london/...
      Last sync'd change: 76672
      No changes since last build.
      [jdk1.6.0_03] $ /scratch/betasx2/wyliek/apache-ant-1.7.0/bin/ant
      -Djdk=jdk1.6.0_03 tests
      Buildfile: build.xml does not exist!
      Build failed
      Recording test results
      finished: FAILURE

      Here's the output on the jdk1.5.0_13 axis run:
      started
      Performing sync with Perforce for: //fotech/shared/lib/java/FPHibernate/head/...
      Changing P4 Client Root to:
      /scratch/betasx2/wyliek/hudson-home/jobs/FPHibernate-Head/workspace/jdk/jdk1.5.0_13/
      Changing P4 Client View to: //fotech/shared/lib/java/FPHibernate/head/...
      //wyliek.hudson-clients.fphibernate-head.london/...
      Last sync'd change: 76672
      No changes since last build.
      [jdk1.5.0_13] $ /scratch/betasx2/wyliek/apache-ant-1.7.0/bin/ant
      -Djdk=jdk1.5.0_13 tests
      Buildfile: build.xml does not exist!
      Build failed
      Recording test results
      finished: FAILURE

        Attachments

          Activity

          Hide
          emmulator emmulator added a comment -

          OK, I've tracked it down to the fact that the same PerforceSCM object instance
          is being used by all the build threads, and they're all simultaneously modifying
          and using the same 'depot' instance variable. If I remove that instance
          variable, it actually works. As demonstrated by the following server log, each
          slave instance/machine is now issuing independent commands:

          2009/10/14 17:51:03 pid 28461 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-workspace -o hudson_sample_matrix-build106'
          2009/10/14 17:51:03 pid 28462 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-changes -m 1 //hudson_sample_matrix-build106/...'
          2009/10/14 17:51:10 pid 28477 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-workspace -o hudson_sample_matrix-build106'
          2009/10/14 17:51:10 pid 28478 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-counter change'
          2009/10/14 17:51:10 pid 28479 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-changes //hudson_sample_matrix-build106/...@96623,@96635'
          2009/10/14 17:51:10 pid 28480 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-describe -s 96635'
          2009/10/14 17:51:10 pid 28481 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-sync //hudson_sample_matrix-build106/...@96635'
          2009/10/14 17:51:12 pid 28483 build.automation@hudson_sample_matrix-build108
          x.x.x.83 'user-workspace -o hudson_sample_matrix-build108'
          2009/10/14 17:51:12 pid 28484 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-workspace -o hudson_sample_matrix-build106'
          2009/10/14 17:51:12 pid 28485 build.automation@hudson_sample_matrix-build107
          x.x.x.81 'user-workspace -o hudson_sample_matrix-build107'
          2009/10/14 17:51:12 pid 28486 build.automation@hudson_sample_matrix-build108
          x.x.x.83 'user-counter change'
          2009/10/14 17:51:12 pid 28487 build.automation@hudson_sample_matrix-build107
          x.x.x.81 'user-counter change'
          2009/10/14 17:51:12 pid 28488 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-counter change'
          2009/10/14 17:51:12 pid 28489 build.automation@hudson_sample_matrix-build108
          x.x.x.83 'user-changes //hudson_sample_matrix-build108/...@96623,@96635'
          2009/10/14 17:51:12 pid 28490 build.automation@hudson_sample_matrix-build107
          x.x.x.81 'user-changes //hudson_sample_matrix-build107/...@96623,@96635'
          2009/10/14 17:51:12 pid 28491 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-changes //hudson_sample_matrix-build106/...@96623,@96635'
          2009/10/14 17:51:12 pid 28492 build.automation@hudson_sample_matrix-build108
          x.x.x.83 'user-describe -s 96635'
          2009/10/14 17:51:12 pid 28493 build.automation@hudson_sample_matrix-build107
          x.x.x.81 'user-describe -s 96635'
          2009/10/14 17:51:12 pid 28494 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-describe -s 96635'
          2009/10/14 17:51:12 pid 28495 build.automation@hudson_sample_matrix-build108
          x.x.x.83 'user-sync //hudson_sample_matrix-build108/...@96635'
          2009/10/14 17:51:12 pid 28496 build.automation@hudson_sample_matrix-build107
          x.x.x.81 'user-sync //hudson_sample_matrix-build107/...@96635'
          2009/10/14 17:51:12 pid 28497 build.automation@hudson_sample_matrix-build106
          x.x.x.79 'user-sync //hudson_sample_matrix-build106/...@96635'

          I also had to change PerforceMailResolver, which was also depending on the
          instance attribute, but I'm not sure where this is used to test whether my
          change to that class worked.

          If I can get commit access to subversion (user 'emmulator') I can submit these
          changes.

          Show
          emmulator emmulator added a comment - OK, I've tracked it down to the fact that the same PerforceSCM object instance is being used by all the build threads, and they're all simultaneously modifying and using the same 'depot' instance variable. If I remove that instance variable, it actually works. As demonstrated by the following server log, each slave instance/machine is now issuing independent commands: 2009/10/14 17:51:03 pid 28461 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-workspace -o hudson_sample_matrix-build106' 2009/10/14 17:51:03 pid 28462 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-changes -m 1 //hudson_sample_matrix-build106/...' 2009/10/14 17:51:10 pid 28477 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-workspace -o hudson_sample_matrix-build106' 2009/10/14 17:51:10 pid 28478 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-counter change' 2009/10/14 17:51:10 pid 28479 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-changes //hudson_sample_matrix-build106/...@96623,@96635' 2009/10/14 17:51:10 pid 28480 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-describe -s 96635' 2009/10/14 17:51:10 pid 28481 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-sync //hudson_sample_matrix-build106/...@96635' 2009/10/14 17:51:12 pid 28483 build.automation@hudson_sample_matrix-build108 x.x.x.83 'user-workspace -o hudson_sample_matrix-build108' 2009/10/14 17:51:12 pid 28484 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-workspace -o hudson_sample_matrix-build106' 2009/10/14 17:51:12 pid 28485 build.automation@hudson_sample_matrix-build107 x.x.x.81 'user-workspace -o hudson_sample_matrix-build107' 2009/10/14 17:51:12 pid 28486 build.automation@hudson_sample_matrix-build108 x.x.x.83 'user-counter change' 2009/10/14 17:51:12 pid 28487 build.automation@hudson_sample_matrix-build107 x.x.x.81 'user-counter change' 2009/10/14 17:51:12 pid 28488 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-counter change' 2009/10/14 17:51:12 pid 28489 build.automation@hudson_sample_matrix-build108 x.x.x.83 'user-changes //hudson_sample_matrix-build108/...@96623,@96635' 2009/10/14 17:51:12 pid 28490 build.automation@hudson_sample_matrix-build107 x.x.x.81 'user-changes //hudson_sample_matrix-build107/...@96623,@96635' 2009/10/14 17:51:12 pid 28491 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-changes //hudson_sample_matrix-build106/...@96623,@96635' 2009/10/14 17:51:12 pid 28492 build.automation@hudson_sample_matrix-build108 x.x.x.83 'user-describe -s 96635' 2009/10/14 17:51:12 pid 28493 build.automation@hudson_sample_matrix-build107 x.x.x.81 'user-describe -s 96635' 2009/10/14 17:51:12 pid 28494 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-describe -s 96635' 2009/10/14 17:51:12 pid 28495 build.automation@hudson_sample_matrix-build108 x.x.x.83 'user-sync //hudson_sample_matrix-build108/...@96635' 2009/10/14 17:51:12 pid 28496 build.automation@hudson_sample_matrix-build107 x.x.x.81 'user-sync //hudson_sample_matrix-build107/...@96635' 2009/10/14 17:51:12 pid 28497 build.automation@hudson_sample_matrix-build106 x.x.x.79 'user-sync //hudson_sample_matrix-build106/...@96635' I also had to change PerforceMailResolver, which was also depending on the instance attribute, but I'm not sure where this is used to test whether my change to that class worked. If I can get commit access to subversion (user 'emmulator') I can submit these changes.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : emmulator
          Path:
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/HudsonP4Executor.java
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceMailResolver.java
          trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java
          trunk/hudson/plugins/perforce/src/test/java/hudson/plugins/perforce/PerforceSCMTest.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=22945
          Log:
          JENKINS-1022 removed 'depot' instance variable that was being modified by multiple threads simultaneously, this allows perforce commands to be issued from the correct slave nodes; also had master matrix job not alter the perforce client root, so that the child matrix job would get the update

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : emmulator Path: trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/HudsonP4Executor.java trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceMailResolver.java trunk/hudson/plugins/perforce/src/main/java/hudson/plugins/perforce/PerforceSCM.java trunk/hudson/plugins/perforce/src/test/java/hudson/plugins/perforce/PerforceSCMTest.java http://fisheye4.cenqua.com/changelog/hudson/?cs=22945 Log: JENKINS-1022 removed 'depot' instance variable that was being modified by multiple threads simultaneously, this allows perforce commands to be issued from the correct slave nodes; also had master matrix job not alter the perforce client root, so that the child matrix job would get the update
          Hide
          emmulator emmulator added a comment -

          I'm not going to mark this fixed, since I realized that it probably only works
          with one axis. Since the plugin still only uses one client-spec per node, if
          the matrix includes multiple axes and two are built on the same node, the
          perforce clients will probably still interfere with each other. If I get a
          chance, I will test that.

          Show
          emmulator emmulator added a comment - I'm not going to mark this fixed, since I realized that it probably only works with one axis. Since the plugin still only uses one client-spec per node, if the matrix includes multiple axes and two are built on the same node, the perforce clients will probably still interfere with each other. If I get a chance, I will test that.
          Hide
          torbent torbent added a comment - - edited

          I suspect the mentioned changes to PerforceMailResolver has caused it to not
          work anymore - please see JENKINS-4933.

          Show
          torbent torbent added a comment - - edited I suspect the mentioned changes to PerforceMailResolver has caused it to not work anymore - please see JENKINS-4933 .
          Hide
          rpetti Rob Petti added a comment -

          Due to the complexities of dealing with multiconfiguration builds, I've changed the behavior of the plugin to always force sync when performing a matrix build. This eliminates the need of having a different client workspace for each and every combination, while still allowing matrix builds to work correctly.

          Show
          rpetti Rob Petti added a comment - Due to the complexities of dealing with multiconfiguration builds, I've changed the behavior of the plugin to always force sync when performing a matrix build. This eliminates the need of having a different client workspace for each and every combination, while still allowing matrix builds to work correctly.

            People

            • Assignee:
              Unassigned
              Reporter:
              kirkwylie kirkwylie
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: