Skip to content

Commit

Permalink
[SPARK-12466] Fix harmless NPE in tests
Browse files Browse the repository at this point in the history
```
[info] ReplayListenerSuite:
[info] - Simple replay (58 milliseconds)
java.lang.NullPointerException
	at org.apache.spark.deploy.master.Master$$anonfun$asyncRebuildSparkUI$1.applyOrElse(Master.scala:982)
	at org.apache.spark.deploy.master.Master$$anonfun$asyncRebuildSparkUI$1.applyOrElse(Master.scala:980)
```
https://amplab.cs.berkeley.edu/jenkins/view/Spark-QA-Test/job/Spark-Master-SBT/4316/AMPLAB_JENKINS_BUILD_PROFILE=hadoop2.2,label=spark-test/consoleFull

This was introduced in #10284. It's harmless because the NPE is caused by a race that occurs mainly in `local-cluster` tests (but don't actually fail the tests).

Tested locally to verify that the NPE is gone.

Author: Andrew Or <[email protected]>

Closes #10417 from andrewor14/fix-harmless-npe.
  • Loading branch information
Andrew Or committed Dec 21, 2015
1 parent a820ca1 commit d655d37
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,11 @@ private[deploy] class Master(

futureUI.onSuccess { case Some(ui) =>
appIdToUI.put(app.id, ui)
self.send(AttachCompletedRebuildUI(app.id))
// `self` can be null if we are already in the process of shutting down
// This happens frequently in tests where `local-cluster` is used
if (self != null) {
self.send(AttachCompletedRebuildUI(app.id))
}
// Application UI is successfully rebuilt, so link the Master UI to it
// NOTE - app.appUIUrlAtHistoryServer is volatile
app.appUIUrlAtHistoryServer = Some(ui.basePath)
Expand Down

0 comments on commit d655d37

Please sign in to comment.