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

ClearCase environment variables not expanded correctly during matrix build

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • clearcase-plugin
    • None
    • Platform: All, OS: All

    Description

      Using 0.8.2-snapshot + hudson 1.278

      I have created a matrix build using 2 nodes (master and one slave) and a second
      axis of TUXVER using the values 8,9,10,11.

      Content of build steps is
      echo "TUXVER= $TUXVER"
      echo "WORKSPACE: $WORKSPACE"
      echo "CLEARCASE_VIEWPATH: $CLEARCASE_VIEWPATH"
      echo "CLEARCASE_VIEWNAME: $CLEARCASE_VIEWNAME"

      Running this build shows that the two CC environment variables are expanded
      incorrectly when given to the build step. They appear correctly expanded when
      creating the views. It looks like a race condition, the project.name has the
      wrong value when we are expanding.

      Relevant part of logs are below

      Build: TUXVER=8,master
      cleartool mkview hudson_test_matrix_node-master_job-TUXVER=8,label=master_view
      TUXVER= 8
      WORKSPACE:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/8/label/master
      CLEARCASE_VIEWPATH:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/8/label/master/hudson_test_matrix_node-master_job-TUXVER=11,label=master_view
      CLEARCASE_VIEWNAME: hudson_test_matrix_node-master_job-TUXVER=11,label=master_view

      Build: TUXVER=9,master
      mkview -snapshot hudson_test_matrix_node-master_job-TUXVER=9,label=master_view
      TUXVER= 9
      WORKSPACE:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/9/label/master
      CLEARCASE_VIEWPATH:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/9/label/master/hudson_test_matrix_node-master_job-TUXVER=8,label=master_view
      CLEARCASE_VIEWNAME: hudson_test_matrix_node-master_job-TUXVER=8,label=master_view

      Build: TUXVER=10,master
      cleartool mkview -snapshot
      hudson_test_matrix_node-master_job-TUXVER=10,label=master_view
      TUXVER= 10
      WORKSPACE:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/10/label/master
      CLEARCASE_VIEWPATH:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/10/label/master/hudson_test_matrix_node-master_job-TUXVER=10,label=master_view
      CLEARCASE_VIEWNAME: hudson_test_matrix_node-master_job-TUXVER=10,label=master_view

      Build: TUXVER=11,master
      cleartool mkview -snapshot
      hudson_test_matrix_node-master_job-TUXVER=11,label=master_view

      WORKSPACE:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/11/label/master
      CLEARCASE_VIEWPATH:
      /export/home/ciuser/hudson/jobs/test_hudson_matrix/workspace/TUXVER/11/label/master/hudson_test_matrix_node-master_job-TUXVER=11,label=master_view
      CLEARCASE_VIEWNAME: hudson_test_matrix_node-master_job-TUXVER=11,label=master_view

      Sometime the values are right.. e.g. when providing this example the values on
      the slave was correct, but it is not consistent. Think it has something to do
      with the executers and timing...

      I am unsure if this is a ClearCase Plugin or a hudson problem, as far as I can
      see we don't do any inappropiate cacheing

      Attachments

        1. 2934.patch
          2 kB
        2. 2934.patch
          1 kB
        3. config.xml
          2 kB

        Activity

          dhauslad dhauslad added a comment -

          The patch that I attached only works in a very simple deployment of Hudson. It fails with a NullPointerException accessing the ThreadLocal instance variable when used in a cluster. So the patch is of no use.

          dhauslad dhauslad added a comment - The patch that I attached only works in a very simple deployment of Hudson. It fails with a NullPointerException accessing the ThreadLocal instance variable when used in a cluster. So the patch is of no use.
          dhauslad dhauslad added a comment -

          Attached a new version of the 2934.patch file that addresses the NullPointerException I encountered when using the modified plugin in a cluster.

          dhauslad dhauslad added a comment - Attached a new version of the 2934.patch file that addresses the NullPointerException I encountered when using the modified plugin in a cluster.
          abayer Andrew Bayer added a comment -

          I'd like to wait on this 'til the next release - just because I've already fixed a bug on variable name expansion for 1.1.1, and I'd like to be sure that works in production before making this change as well. I should be releasing 1.1.1 a week from today (1/15) - I want to give it another week to see what other bugs come in from the 1.1 release.

          abayer Andrew Bayer added a comment - I'd like to wait on this 'til the next release - just because I've already fixed a bug on variable name expansion for 1.1.1, and I'd like to be sure that works in production before making this change as well. I should be releasing 1.1.1 a week from today (1/15) - I want to give it another week to see what other bugs come in from the 1.1 release.
          abayer Andrew Bayer added a comment -

          Fixed in trunk.

          abayer Andrew Bayer added a comment - Fixed in trunk.

          Code changed in hudson
          User: : abayer
          Path:
          trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=25724
          Log:
          [FIXED JENKINS-2934] normalizedViewName is now thread-local, which should hopefully mean it will work properly in matrix configurations

          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : abayer Path: trunk/hudson/plugins/clearcase/src/main/java/hudson/plugins/clearcase/AbstractClearCaseScm.java http://fisheye4.cenqua.com/changelog/hudson/?cs=25724 Log: [FIXED JENKINS-2934] normalizedViewName is now thread-local, which should hopefully mean it will work properly in matrix configurations

          People

            abayer Andrew Bayer
            lynggaard lynggaard
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: