private void failure(String detail) {
        if (failingSinceNanos.compareAndSet(never, nanoClock.getAsLong()))
            this.detail.set(detail);
    }
Creates a new circuit breaker with the given grace periods.
@param grace the period of consecutive failures before state changes to half-open.
@param doom the period of consecutive failures before shutting down.
vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/GracePeriodCircuitBreaker.java