Skip to content

Commit

Permalink
Fix app status reporting.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Aug 21, 2014
1 parent c0794be commit 41f8c8a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
logInfo(s"Finishing ApplicationMaster with $status" +
Option(diagnostics).map(msg => s" (diag message: $msg)").getOrElse(""))
finished = true
finalStatus = status
reporterThread.interrupt()
try {
if (Thread.currentThread() != reporterThread) {
Expand Down Expand Up @@ -341,17 +342,19 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,

val t = new Thread {
override def run() {
var status = FinalApplicationStatus.FAILED
try {
// Copy
val mainArgs = new Array[String](args.userArgs.size)
args.userArgs.copyToArray(mainArgs, 0, args.userArgs.size)
mainMethod.invoke(null, mainArgs)
// Some apps have "System.exit(0)" at the end. The user thread will stop here unless
// it has an uncaught exception thrown out. It needs a shutdown hook to set SUCCEEDED.
finalStatus = FinalApplicationStatus.SUCCEEDED
status = FinalApplicationStatus.SUCCEEDED
} finally {
logDebug("Finishing main")
}
finalStatus = status
}
}
t.setName("Driver")
Expand Down

0 comments on commit 41f8c8a

Please sign in to comment.