-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.462.1
branch-api 2.1178.v969d9eb_c728e
We have observed on our Jenkins instance that on Jenkins startup, when Jenkins connects to the agents, active workspaces are being incorrectly deleted with the following message recorded in the agent logs:
// deleting obsolete workspace /var/lib/jenkins/workspace/...
I cannot reproduce the issue by disconnecting and reconnecting agents after Jenkins has already started up.
Our Jenkins controller has a fairly large number of jobs (around 240 repos in a Github organization folder). The Jenkins startup logs indicate that it takes a couple of minutes to load all the jobs, completing a couple of minutes after the agents are first launched. I suspect there is a race condition in WorkspaceLocatorImpl.Collector where the cleanup process is attempting to access jobs before they have been loaded, resulting in the workspace being deleted incorrectly.