docs: private void cleanUpDriverResources() {
      ctrlc.setComplete();
      try {
        Runtime.getRuntime().removeShutdownHook(ctrlc);
      }
      catch (IllegalStateException ignore) {
        // If "Shutdown in progress" exception would be thrown, just ignore and don't bother to remove the hook.
      }
      ctrlc = null;
  
      try {
        setShutdownRequested();
        driverCallbackSocket.close();
        driverCallbackSocket = null;
      }
      catch (Exception e) {
        System.out.println("ERROR: " + (e.getMessage() != null ? e.getMessage() : "(null)"));
        e.printStackTrace();
      }
  
      // At this point, resources are released.
      // The hadoop job has completed (job.isComplete() is true),
      // so the cluster memory and cpus are freed.
      // The driverCallbackSocket has been closed so a new one can be made.
  
      // The callbackManager itself may or may not have finished, but it doesn't
      // matter since the server socket has been closed.
    }