public final void doMaintain(boolean force) {
        if (!force && !jobControl.isActive(name())) return;
        log.log(Level.FINE, () -> "Running " + this.getClass().getSimpleName());

        double successFactorDeviation = -1;
        long startTime = clock.millis();
        try {
            if (acquireLock) {
                try (var lock = jobControl.lockJob(name())) {
                    successFactorDeviation = maintain();
                } catch (UncheckedTimeoutException e) {
                    if (ignoreCollision)
                        successFactorDeviation = 0;
                    else
                        log.log(Level.WARNING, this + " collided with another run. Will retry in " + interval);
                }
            } else {
                successFactorDeviation = maintain();
            }
        }  catch (Throwable e) {
            log.log(Level.WARNING, this + " failed. Will retry in " + interval, e);
        } finally {
            long endTime = clock.millis();
            jobMetrics.completed(name(), successFactorDeviation, endTime - startTime);
        }
        log.log(Level.FINE, () -> "Finished " + this.getClass().getSimpleName());
    }
Run this while holding the job lock, as necessary
vespajlib/src/main/java/com/yahoo/concurrent/maintenance/Maintainer.java