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

Concurrent Groovy Shared Library syncs on different jobs use same workspace root


    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Environment:
    • Similar Issues:


      We're encountering an issue where multiple jobs syncing a groovy shared library concurrently results in the wrong sync root being used for some of the jobs. For example, job1 and job2 are triggered at the same time and use the p4 plugin for syncing the groovy shared library. job1 will have the correct workspace root (e.g.  /var/lib/jenkins/jobs/job1/workspace%40libs/LIBRARYNAME) for the groovy shared library sync, but job2 will sync the groovy shared library to the same workspace root as job1 (e.g.  /var/lib/jenkins/jobs/job1/workspace%40libs/LIBRARYNAME). When job2 loads the groovy shared library, it references what the workspace root should be for job2 (e.g.  /var/lib/jenkins/jobs/job2/workspace%40libs/LIBRARYNAME), which was not sync'd to, and causes job2 to run based off of an old groovy shared library sync.


        1. error_logs.txt
          2 kB
        2. job1.txt
          4 kB
        3. job2.txt
          4 kB


          kroutley Kurt Routley created issue -
          p4paul Paul Allen made changes -
          Field Original Value New Value
          Status Open [ 1 ] Closed [ 6 ]
          Assignee Paul Allen [ p4paul ]
          Resolution Fixed [ 1 ]
          svschubert Sven Schubert made changes -
          Attachment error_logs.txt [ 44723 ]
          svschubert Sven Schubert made changes -
          Comment [ This bug still exists with version 1.8.14 of the P4 plugin, and Pipeline 2.5:  We have one shared library configured in Jenkins. If the Jenkins tries to start multiple jobs (A, B, C) at the same time (e.g. because an upstream project has been built and multiple jobs depend on this project), only the first job (A) will be able to load the shared library. The other jobs (B, C) get confused about the workspace when trying to load the shared library, e.g. job B tries to find the shared library (pipeline-commons) within the workspace of another job and not within his own workspace ([^error_logs.txt]).

          If the jobs are not started at the same time, everything works fine. 

           * Pipeline: 2.5
           * Pipeline: Groovy (workflow-cps): 2.54 
           * Pipeline: Shared Groovy Libraries (workflow-cps-global-lib): 2.9 ]
          svschubert Sven Schubert made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          p4paul Paul Allen made changes -
          Labels root shared-groovy-libraries sync P4_A root shared-groovy-libraries sync
          p4paul Paul Allen made changes -
          Status Reopened [ 4 ] Fixed but Unreleased [ 10203 ]
          Resolution Fixed [ 1 ]
          p4paul Paul Allen made changes -
          Status Fixed but Unreleased [ 10203 ] Closed [ 6 ]
          jazzyjayx Jay Spang made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]


            • Assignee:
              p4paul Paul Allen
              kroutley Kurt Routley
            • Votes:
              2 Vote for this issue
              8 Start watching this issue


              • Created: