@Override
  public boolean isExpired(NetworkRequest request) {
    if (request.equals(EmptyRequest.getInstance())) {
      // This is a internal generated request used to signal shutdown. Don't consider it as expired.
      return false;
    }
    long currentTimeMs = time.milliseconds();
    long requestDelayMs = currentTimeMs - request.getStartTimeInMs();

    long localMinDelayMs = this.minDelayMs;

    // Try and determine if we should reset
    // the delay time and determine overload
    if (currentTimeMs > intervalTimeMs && resetDelay.compareAndSet(false, true)) {
      intervalTimeMs = currentTimeMs + coDelIntervalMs;

      isOverloaded.set(localMinDelayMs > coDelTargetDelayMs);
    }

    // If it looks like we should reset the delay
    // time do it only once on one thread
    if (resetDelay.compareAndSet(true, false)) {
      minDelayMs = requestDelayMs;
      return false;
    } else if (requestDelayMs < localMinDelayMs) {
      minDelayMs = requestDelayMs;
    }

    return isOverloaded.get() && requestDelayMs > 2 * coDelTargetDelayMs;
  }
Controlled delay logic is implemented here.
@param request to validate
@return {@code true} if this request needs to be dropped to reduce overload based on request creation timestamp and
        internal queue state (deemed overloaded).
ambry-network/src/main/java/com/github/ambry/network/AdaptiveLifoCoDelNetworkRequestQueue.java