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
        

          [JENKINS-60213] P4_CLIENT environment variable non-reentrant

          James Bateman created issue -
          James Bateman made changes -
          Priority Original: Minor [ 4 ] New: Major [ 3 ]
          James Bateman made changes -
          Attachment New: Build History.png [ 49551 ]
          James Bateman made changes -
          Attachment New: screenshot-1.png [ 49552 ]
          James Bateman made changes -
          Attachment New: JENKINS-60213__JobConfig.png [ 49553 ]
          Karl Wirth made changes -
          Labels New: P4_VERIFY
          Karl Wirth made changes -
          Comment [ [~jbateman]

          Thanks but no it didn't. That was 3 separate overlapping runs. Note that there is no '@' in the workspace name. Investigating if this is a problem with my test or the nightly build. ]
          Karl Wirth made changes -
          Labels Original: P4_VERIFY New: P4_A P4_VERIFY
          Karl Wirth made changes -
          Link New: This issue is related to JENKINS-48882 [ JENKINS-48882 ]
          Karl Wirth made changes -
          Summary Original: P4 environment variables non-reentrant New: P4CLIENT environment variable non-reentrant
          Matthew Smeeth made changes -
          Assignee New: Matthew Smeeth [ msmeeth ]

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

              Created:
              Updated:
              Resolved: