Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ private[spark] class Executor(

// Don't forcibly exit unless the exception was inherently fatal, to avoid
// stopping other tasks unnecessarily.
if (Utils.isFatalError(t)) {
if (Utils.isFatalError(t) && !Utils.isLinkageError(t)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's conceivable this could just be 'whitelisted' as a non-fatal error, but that bears checking where else this is used. I'm not sure I agree with the premise of the change though.

SparkUncaughtExceptionHandler.uncaughtException(t)
}

Expand Down
6 changes: 6 additions & 0 deletions core/src/main/scala/org/apache/spark/util/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1872,6 +1872,12 @@ private[spark] object Utils extends Logging {
}
}

/** Returns true if the given exception is a linkage error. */
def isLinkageError(e: Throwable): Boolean = e match {
case _: java.lang.LinkageError => true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can just be e.instanceOf[LinkageError] but an entire method for this is not appropriate

case _ => false
}

/**
* Return a well-formed URI for the file described by a user input string.
*
Expand Down
9 changes: 9 additions & 0 deletions core/src/test/scala/org/apache/spark/FailureSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,15 @@ class FailureSuite extends SparkFunSuite with LocalSparkContext {
rdd.count()
}

test("SPARK-16304: Link error should not crash executor") {
sc = new SparkContext("local[1,2]", "test")
intercept[SparkException] {
sc.parallelize(1 to 2).foreach { i =>
throw new LinkageError()
}
}
}

// TODO: Need to add tests with shuffle fetch failures.
}

Expand Down