Github user vanzin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/20388#discussion_r163939193
  
    --- Diff: 
launcher/src/main/java/org/apache/spark/launcher/LauncherServer.java ---
    @@ -376,9 +353,23 @@ public void close() throws IOException {
             clients.remove(this);
           }
     
    -      synchronized (this) {
    -        super.close();
    -        notifyAll();
    +      super.close();
    +    }
    +
    +    /**
    +     * Close the connection and wait for any buffered data to be processed 
before returning.
    +     * This ensures any changes reported by the child application take 
effect.
    +     */
    +    public void closeAndWait() throws IOException {
    +      close();
    +
    +      Thread connThread = this.connectionThread;
    +      if (Thread.currentThread() != connThread) {
    --- End diff --
    
    More of a safeguard. I don't think it would happen in this version of the 
code, but better be safe.


---

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

Reply via email to