-
- Downloads
[SPARK-9844][CORE] File appender race condition during shutdown
When an Executor process is destroyed, the FileAppender that is asynchronously reading the stderr stream of the process can throw an IOException during read because the stream is closed. Before the ExecutorRunner destroys the process, the FileAppender thread is flagged to stop. This PR wraps the inputStream.read call of the FileAppender in a try/catch block so that if an IOException is thrown and the thread has been flagged to stop, it will safely ignore the exception. Additionally, the FileAppender thread was changed to use Utils.tryWithSafeFinally to better log any exception that do occur. Added unit tests to verify a IOException is thrown and logged if FileAppender is not flagged to stop, and that no IOException when the flag is set. Author: Bryan Cutler <cutlerb@gmail.com> Closes #10714 from BryanCutler/file-appender-read-ioexception-SPARK-9844.
Showing
- core/src/main/scala/org/apache/spark/util/logging/FileAppender.scala 18 additions, 10 deletions...in/scala/org/apache/spark/util/logging/FileAppender.scala
- core/src/test/scala/org/apache/spark/util/FileAppenderSuite.scala 77 additions, 0 deletions.../test/scala/org/apache/spark/util/FileAppenderSuite.scala
Loading
Please register or sign in to comment