public void shutdown() {
    try {
      logger.info("shutting down");
      for (RequestHandler handler : handlers) {
        handler.shutdown();
      }
      for (Thread thread : threads) {
        thread.join();
      }
      // Shutdown request response channel to release memory of any requests still present in the channel
      if(requestResponseChannel != null){
        requestResponseChannel.shutdown();
      }
      logger.info("shut down completely");
    } catch (Exception e) {
      logger.error("error when shutting down request handler pool", e);
    }
  }
Drain the pool: shut down the handler threads.
ambry-protocol/src/main/java/com/github/ambry/protocol/RequestHandlerPool.java