code: @Override
    public void stop() throws Exception {
      mStopped = true;
      if (mServerSocket != null) {
        try {
          mServerSocket.close();
        } catch (IOException e) {
          LOG.warn("Exception in closing server socket: {}", e);
        }
      }
      mThreadPool.shutdownNow();
      // Close all client sockets so that their serving threads can stop. We shut down the threadpool
      // before closing the sockets so that no new socket threads will be created after we try to
      // close them all.
      synchronized (mClientSockets) {
        for (Socket socket : mClientSockets) {
          try {
            socket.close();
          } catch (IOException e) {
            LOG.warn("Exception in closing client socket: {}", e);
          }
        }
      }
      boolean ret = mThreadPool.awaitTermination(THREAD_KEEP_ALIVE_TIME_MS, TimeUnit.MILLISECONDS);
      if (ret) {
        LOG.info("All worker threads have terminated.");
      } else {
        LOG.warn("Log server has timed out waiting for worker threads to terminate.");
      }
    }
docs: {@inheritDoc}
  
  Stops the main thread of {@link AlluxioLogServerProcess}.
  
  Close the server socket, shutdown the thread pool, stop accepting new requests,
  and blocks until all worker threads terminate.