Skip to content
Snippets Groups Projects
Commit 16b7f1df authored by Marcelo Vanzin's avatar Marcelo Vanzin
Browse files

[SPARK-14391][LAUNCHER] Fix launcher communication test, take 2.

There's actually a race here: the state of the handler was changed before
the connection was set, so the test code could be notified of the state
change, wake up, and still see the connection as null, triggering the assert.

Author: Marcelo Vanzin <vanzin@cloudera.com>

Closes #12785 from vanzin/SPARK-14391.

(cherry picked from commit 73c20bf3)
parent 20834859
No related branches found
No related tags found
No related merge requests found
...@@ -298,8 +298,8 @@ class LauncherServer implements Closeable { ...@@ -298,8 +298,8 @@ class LauncherServer implements Closeable {
Hello hello = (Hello) msg; Hello hello = (Hello) msg;
ChildProcAppHandle handle = pending.remove(hello.secret); ChildProcAppHandle handle = pending.remove(hello.secret);
if (handle != null) { if (handle != null) {
handle.setState(SparkAppHandle.State.CONNECTED);
handle.setConnection(this); handle.setConnection(this);
handle.setState(SparkAppHandle.State.CONNECTED);
this.handle = handle; this.handle = handle;
} else { } else {
throw new IllegalArgumentException("Received Hello for unknown client."); throw new IllegalArgumentException("Received Hello for unknown client.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment