Github user cloud-fan commented on a diff in the pull request:
https://github.com/apache/spark/pull/20388#discussion_r163743675
--- 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 --
Is this a safeguard or it can really happen? i.e. the connection thread
calls `closeAndWait`.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]