Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/20388#discussion_r163938633
--- Diff:
launcher/src/main/java/org/apache/spark/launcher/AbstractAppHandle.java ---
@@ -29,15 +30,15 @@
private final LauncherServer server;
- private LauncherConnection connection;
+ private LauncherServer.ServerConnection connection;
private List<Listener> listeners;
- private State state;
+ private AtomicReference<State> state;
--- End diff --
With the new code, synchronization would cause a deadlock.
- handle calls `closeAndWait()` inside synchronized block which joins
connection thread
- connection thread would call `setState()` on the handle and cause a
deadlock
Changing the state should be as thread-safe as before with the new code.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]