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

P4_CLIENT environment variable non-reentrant

XMLWordPrintable

      Version 1.10.6 of the p4-plugin causes issues when multiple jobs are ran in parallel.

      The result is that the p4 created environment variables of one job can corrupt those in another job that is running at the same time.

      This bug wasn't in 1.10.5

      Steps to reproduce issue:

      • Create a new Jenkins test job with the following settings
        • General:
          • Execute concurrent builds if necessary
          • Use custom workspace
            • Directory
              /tmp/${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}
        • Source Code Management
          • Perforce Software:
            • Workspace behaviour: Template (view generated for each node)
              • Template workspace: Your test template
              • Workspace Name Format being
                 jenkins-${NODE_NAME}-${JOB_NAME}-${EXECUTOR_NUMBER}
      • Add a build step

      To see the issue:

      • Kick off two runs of the newly creates client

      Result:

      • Pre 1.10.5 both would have worked and both will set the expected P4 environment variables.
      • 1.10.6 gets confused. So in my case:

        Job1 Environment variables

        P4_CLIENT	_jenkins-master-ClientClashTest-0
        WORKSPACE	/tmp/master-ClientClashTest-0
        

        Job2 Environment variables (THIS IS THE ISSUE – Wrong P4_CLIENT value)

        P4_CLIENT	_jenkins-master-ClientClashTest-0
        WORKSPACE	/tmp/master-ClientClashTest-1
        

        If I reinstall the 1.10.5 (or earlier) plugin then for job 2 I would see:

        P4_CLIENT	_jenkins-master-ClientClashTest-1
        WORKSPACE	/tmp/master-ClientClashTest-1
        

            msmeeth Matthew Smeeth
            jbateman James Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: