Skip to content

Commit

Permalink
Do not interrupt reporter thread from within itself.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Vanzin committed Aug 26, 2014
1 parent 3a8ed37 commit ff389ed
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
Option(diagnostics).map(msg => s" (diag message: $msg)").getOrElse(""))
finished = true
finalStatus = status
reporterThread.interrupt()
try {
if (Thread.currentThread() != reporterThread) {
reporterThread.interrupt()
reporterThread.join()
}
} finally {
Expand Down Expand Up @@ -213,12 +213,14 @@ private[spark] class ApplicationMaster(args: ApplicationMasterArguments,
override def run() {
while (!finished) {
checkNumExecutorsFailed()
logDebug("Sending progress")
allocator.allocateResources()
try {
Thread.sleep(interval)
} catch {
case e: InterruptedException =>
if (!finished) {
logDebug("Sending progress")
allocator.allocateResources()
try {
Thread.sleep(interval)
} catch {
case e: InterruptedException =>
}
}
}
}
Expand Down

0 comments on commit ff389ed

Please sign in to comment.