Class CreateOSSandboxSweep

All Implemented Interfaces:
ExtensionPoint, Runnable

@Extension public class CreateOSSandboxSweep extends AsyncPeriodicWork
Destroys sandboxes this controller created but no longer has an agent for.

This is what makes it safe for CreateOSCloud.recoverStaleAgents() to reconnect an agent instead of terminating it. Reconnecting accepts that a sandbox can outlive the controller process; without a sweep, a node that disappears while the controller is down — deleted by an administrator, lost with a rolled-back JENKINS_HOME, or abandoned when a reconnect deadline passed unobserved — would leave a microVM billing with nothing left to attribute it to. Terminating on startup used to rule that out by construction.

Only sandboxes named by this controller are considered, so a sandbox belonging to another Jenkins instance on the same CreateOS account, or to a human, is never touched.

  • Constructor Details

    • CreateOSSandboxSweep

      public CreateOSSandboxSweep()
      Registers the sweep with Jenkins' periodic work scheduler.
  • Method Details