Class FreestyleBuildTracker

java.lang.Object
hudson.model.listeners.RunListener<AbstractBuild<?,?>>
io.jenkins.plugins.smartexecutorloadbalancer.FreestyleBuildTracker
All Implemented Interfaces:
ExtensionPoint

@Extension public class FreestyleBuildTracker extends RunListener<AbstractBuild<?,?>>
Catches freestyle build failures where the shell step returns a non-zero exit code without throwing an exception — those do not reach NodeExecutorTracker.taskCompletedWithProblems(Executor, Queue.Task, long, Throwable) because the executor slot itself finishes cleanly.

Pipeline (WorkflowRun) failures are intentionally excluded here: each pipeline agent block fires NodeExecutorTracker independently with stage-level granularity.

When a freestyle build fails due to an infrastructure fault (channel crash, OOM …), both this listener and NodeExecutorTracker.taskCompletedWithProblems(Executor, Queue.Task, long, Throwable) fire for the same event — RunListener always fires first. This class records CODE_FAULT unconditionally; NodeLabelStats.addRecord(BuildRecord, int) replaces it with the subsequent NODE_FAULT when the two arrive within 10 seconds of each other.