Class OrphanedInstanceReaper

All Implemented Interfaces:
ExtensionPoint, Runnable

@Extension public class OrphanedInstanceReaper extends AsyncPeriodicWork
Destroys Namespace instances this controller created but no longer tracks.

An instance is orphaned when its Jenkins node is gone — the controller crashed between creating the instance and registering the node, an admin deleted the node by hand, or a config change dropped the cloud. Namespace's per-instance deadline eventually reclaims these anyway, but that can be hours of paid compute; this closes the gap to minutes.

Only instances labelled with NamespaceCloud.LABEL_CLOUD matching a cloud defined on this controller are considered, so two Jenkins instances sharing one Namespace workspace never reap each other's agents.