Skip to content

Commit b1bd1dd

Browse files
Davies LiuJoshRosen
Davies Liu
authored andcommitted
[SPARK-5788] [PySpark] capture the exception in python write thread
The exception in Python writer thread will shutdown executor. Author: Davies Liu <[email protected]> Closes apache#4577 from davies/exception and squashes the following commits: eb0ceff [Davies Liu] Update PythonRDD.scala 139b0db [Davies Liu] capture the exception in python write thread
1 parent 1294a6e commit b1bd1dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/org/apache/spark/api/python/PythonRDD.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,13 +248,13 @@ private[spark] class PythonRDD(
248248
} catch {
249249
case e: Exception if context.isCompleted || context.isInterrupted =>
250250
logDebug("Exception thrown after task completion (likely due to cleanup)", e)
251-
worker.shutdownOutput()
251+
Utils.tryLog(worker.shutdownOutput())
252252

253253
case e: Exception =>
254254
// We must avoid throwing exceptions here, because the thread uncaught exception handler
255255
// will kill the whole executor (see org.apache.spark.executor.Executor).
256256
_exception = e
257-
worker.shutdownOutput()
257+
Utils.tryLog(worker.shutdownOutput())
258258
} finally {
259259
// Release memory used by this thread for shuffles
260260
env.shuffleMemoryManager.releaseMemoryForThisThread()

0 commit comments

Comments
 (0)