srowen commented on a change in pull request #24796: [SPARK-27900][CORE] Add 
uncaught exception handler to the driver
URL: https://github.com/apache/spark/pull/24796#discussion_r290506461
 
 

 ##########
 File path: 
core/src/main/scala/org/apache/spark/util/SparkUncaughtExceptionHandler.scala
 ##########
 @@ -41,13 +48,19 @@ private[spark] class SparkUncaughtExceptionHandler(val 
exitOnUncaughtException:
       if (!ShutdownHookManager.inShutdown()) {
         exception match {
           case _: OutOfMemoryError =>
-            System.exit(SparkExitCode.OOM)
+            // we need to exit immediately no space for graceful shutdown here
+            // we cannot assume the jvm is healthy
+            sysExit(SparkExitCode.OOM, isDriver)
           case e: SparkFatalException if 
e.throwable.isInstanceOf[OutOfMemoryError] =>
             // SPARK-24294: This is defensive code, in case that 
SparkFatalException is
             // misused and uncaught.
-            System.exit(SparkExitCode.OOM)
+            sysExit(SparkExitCode.OOM, isDriver)
+          case _: VirtualMachineError if exitOnUncaughtException =>
+            // we need to exit immediately no space for graceful shutdown here
+            // we cannot assume the jvm is healthy
+            sysExit(SparkExitCode.OOM, isDriver)
 
 Review comment:
   This seems like the wrong code; maybe a new one is needed, not sure

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to