@Override
  public void shutdown() {
    long shutdownBeginTime = System.currentTimeMillis();
    try {
      if (isRunning()) {
        isRunning = false;
        logger.info("Shutting down AsyncRequestResponseHandler");
        for (AsyncRequestWorker asyncRequestWorker : asyncRequestWorkers) {
          try {
            long workerShutdownBeginTime = System.currentTimeMillis();
            if (!asyncRequestWorker.shutdown(30, TimeUnit.SECONDS)) {
              logger.error("Shutdown of AsyncRequestWorker failed. This should not happen");
              metrics.requestResponseHandlerShutdownError.inc();
            }
            long workerShutdownTime = System.currentTimeMillis() - workerShutdownBeginTime;
            metrics.requestWorkerShutdownTimeInMs.update(workerShutdownTime);
            logger.info("AsyncRequestWorker shutdown took {} ms", workerShutdownTime);
          } catch (InterruptedException e) {
            logger.error("Await shutdown of AsyncRequestWorker was interrupted. It might not have shutdown", e);
            metrics.requestResponseHandlerShutdownError.inc();
          }
        }
        asyncResponseHandler.close();
      }
    } finally {
      long shutdownTime = System.currentTimeMillis() - shutdownBeginTime;
      logger.info("AsyncRequestResponseHandler shutdown took {} ms", shutdownTime);
      metrics.requestResponseHandlerShutdownTimeInMs.update(shutdownTime);
    }
  }
Does shutdown tasks for the AsyncRequestResponseHandler. When the function returns, shutdown is FULLY complete.
<p/>
Any requests/responses in flight during shutdown might be dropped.
ambry-rest/src/main/java/com/github/ambry/rest/AsyncRequestResponseHandler.java