@Override
  public void userEventTriggered(ChannelHandlerContext ctx, Object event) {
    // NOTE: This is specifically in place to handle connections that close unexpectedly from the client side.
    // Even in that situation, any cleanup code that we have in the handlers will have to be called.
    if (event instanceof IdleStateEvent && ((IdleStateEvent) event).state() == IdleState.ALL_IDLE) {
      logger.info("Channel {} has been idle for {} seconds. Closing it", ctx.channel(),
          nettyConfig.nettyServerIdleTimeSeconds);
      nettyMetrics.idleConnectionCloseCount.inc();
      if (request != null && request.isOpen()) {
        onRequestAborted(Utils.convertToClientTerminationException(new ClosedChannelException()));
      } else {
        close();
      }
    }
  }
Netty calls this function when events that we have registered for, occur (in this case we are specifically waiting
for {@link IdleStateEvent} so that we close connections that have been idle too long - maybe due to client failure)
@param ctx The {@link ChannelHandlerContext} that can be used to perform operations on the channel.
@param event The event that occurred.
ambry-rest/src/main/java/com/github/ambry/rest/NettyMessageProcessor.java