mingkangli-db commented on code in PR #48551:
URL: https://github.com/apache/spark/pull/48551#discussion_r1806986733
##########
core/src/test/scala/org/apache/spark/util/SparkUncaughtExceptionHandlerSuite.scala:
##########
@@ -74,6 +80,34 @@ object ThrowableTypes extends Enumeration {
val SparkFatalOutOfMemoryError =
ThrowableTypesVal("SparkFatalException(OutOfMemoryError)",
new SparkFatalException(new OutOfMemoryError))
+ // SPARK-50034: If there is a fatal error in the cause chain,
+ // we should also identify that fatal error and exit with the
+ // correct exit code.
+ val NestedOOMError = ThrowableTypesVal(
+ "DeepNestedFatalError",
+ new RuntimeException("Nonfatal Level 1",
+ new RuntimeException("Nonfatal Level 2",
+ new RuntimeException("Nonfatal Level 3",
+ new OutOfMemoryError())))
+ )
+
+ val NestedSparkFatalException = ThrowableTypesVal(
+ "DeepNestedMixedFatalErrors",
+ new RuntimeException("Nonfatal Level 1",
+ new RuntimeException("Nonfatal Level 2",
+ new SparkFatalException(new OutOfMemoryError())))
+ )
+
+ // Nested exception with non-fatal errors only
+ val NonFatalNestedErrors = ThrowableTypesVal(
Review Comment:
Good point. Added a test case to cover this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]