Github user squito commented on a diff in the pull request:
https://github.com/apache/spark/pull/20987#discussion_r179776639
--- Diff: core/src/test/scala/org/apache/spark/executor/ExecutorSuite.scala
---
@@ -173,8 +173,26 @@ class ExecutorSuite extends SparkFunSuite with
LocalSparkContext with MockitoSug
}
test("SPARK-19276: OOMs correctly handled with a FetchFailure") {
+ val (failReason, uncaughtExceptionHandler) =
testFetchFailureHandling(true)
+ assert(failReason.isInstanceOf[ExceptionFailure])
+ val exceptionCaptor = ArgumentCaptor.forClass(classOf[Throwable])
+ verify(uncaughtExceptionHandler).uncaughtException(any(),
exceptionCaptor.capture())
+ assert(exceptionCaptor.getAllValues.size === 1)
+
assert(exceptionCaptor.getAllValues().get(0).isInstanceOf[OutOfMemoryError])
+ }
+
+ test(s"SPARK-23816: interrupts are not masked by a FetchFailure") {
+ // If killing the task causes a fetch failure, we still treat it as a
task that was killed,
+ // as the fetch failure could easily be caused by interrupting the
thread.
+ val (failReason, _) = testFetchFailureHandling(false)
+ assert(failReason.isInstanceOf[TaskKilled])
+ }
+
+ def testFetchFailureHandling(oom: Boolean): (TaskFailedReason,
UncaughtExceptionHandler) = {
--- End diff --
yeah good point, this is pretty confusing now, I pushed an update with more
comments
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]