Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20297#discussion_r162525240
  
    --- Diff: 
launcher/src/main/java/org/apache/spark/launcher/LauncherServer.java ---
    @@ -331,23 +358,27 @@ protected void handle(Message msg) throws IOException 
{
               timeout.cancel();
             }
             close();
    +        if (handle != null) {
    +          handle.dispose();
    +        }
           } finally {
             timeoutTimer.purge();
           }
         }
     
         @Override
         public void close() throws IOException {
    +      if (!isOpen()) {
    +        return;
    +      }
    +
           synchronized (clients) {
             clients.remove(this);
           }
    -      super.close();
    -      if (handle != null) {
    -        if (!handle.getState().isFinal()) {
    -          LOG.log(Level.WARNING, "Lost connection to spark application.");
    -          handle.setState(SparkAppHandle.State.LOST);
    -        }
    -        handle.disconnect();
    +
    +      synchronized (this) {
    +        super.close();
    +        notifyAll();
    --- End diff --
    
    why `notifyAll`? who might be waiting?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to