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

Launching two nodes with similar workspace deletes in use workspaces

XMLWordPrintable

      We run Jenkins with configuration as code in two environments:

      • Dev - For testing changes to our configuration and jobs
      • Prod - Used by all developers

      Some jobs are multibranch jobs, and most are normal pipeline jobs. 

      We recently started seeing the following message pop up in the multibranch job:

      ERROR: missing workspace /localdata/jenkins_workspace/workspace/<job_name> on <node_name>
      

      And we have now tracked this down to being caused by a job running in prod while at the same time someone launching Jenkins locally in their Dev environment. 

      After placing an immutable file in the workspace we got the following output in the Jenkins boot: 

      WARNING	j.b.WorkspaceLocatorImpl$Collector#onOnline: could not delete workspace /localdata/jenkins_workspace/workspace/<job_name>
      

      So apparently there does not seem to be any sort of check to see if any of the workspaces it decides to delete/clean are actually in use by anyone else. 

      Given that we are using two separate Jenkins nodes, and they both connect to the same workspace I admit we might be out of scope here, but I wanted to ask if this is something that can be avoided? does the {{workspace/workspaces.txt }}file have any purpose here?

      Having these two almost identical dev/prod environments allows us a good workflow of testing changes before pushing to production.

            Unassigned Unassigned
            martinn_graphcore Martin Nordsletten
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: