@Override
  public void close() {
    if (isOpen.compareAndSet(true, false) && !group.isTerminated()) {
      group.shutdownGracefully();
      try {
        if (!group.awaitTermination(30, TimeUnit.SECONDS)) {
          throw new IllegalStateException("Client did not close within timeout");
        }
      } catch (InterruptedException e) {
        throw new IllegalStateException(e);
      }
    }
  }
Closes the netty client.
@throws IllegalStateException if the client did not close within a timeout or was interrupted while closing.
ambry-test-utils/src/main/java/com/github/ambry/rest/NettyClient.java