Skip to content

Commit

Permalink
Close appender saving stdout/stderr before destroying process to avoi…
Browse files Browse the repository at this point in the history
…d exception on reading closed input stream
  • Loading branch information
srowen committed Feb 26, 2015
1 parent e43139f commit e0cdabf
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,13 @@ private[spark] class ExecutorRunner(
var exitCode: Option[Int] = None
if (process != null) {
logInfo("Killing process!")
process.destroy()
process.waitFor()
if (stdoutAppender != null) {
stdoutAppender.stop()
}
if (stderrAppender != null) {
stderrAppender.stop()
}
process.destroy()
exitCode = Some(process.waitFor())
}
worker ! ExecutorStateChanged(appId, execId, state, message, exitCode)
Expand Down

0 comments on commit e0cdabf

Please sign in to comment.