Skip to content

[JENKINS-73689] Active workspaces deleted on Jenkins startup #786

@jenkins-infra-bot

Description

@jenkins-infra-bot

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.


Originally reported by joedenniss, imported from: Active workspaces deleted on Jenkins startup
  • status: Open
  • priority: Minor
  • component(s): branch-api-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 1
  • imported: 20251211-141027
Raw content of original issue

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.

environment
Jenkins 2.462.1<br/>
branch-api 2.1178.v969d9eb_c728e

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions