Github user mridulm commented on a diff in the pull request: https://github.com/apache/spark/pull/18213#discussion_r120523334 --- Diff: resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/ApplicationMaster.scala --- @@ -229,8 +229,17 @@ private[spark] class ApplicationMaster( } if (!unregistered) { + // Only when ApplicationMaster's exit code is "EXIT_REPORTER_FAILURE" or "EXIT_EARLY" or + // "EXIT_UNCAUGHT_EXCEPTION" we should let RM to do reattempt. If the exception is from + // Spark internally, for example illegal state, executor failure, user code bug, we + // should not trigger another attempt. + val shouldUnregister = !(exitCode == ApplicationMaster.EXIT_REPORTER_FAILURE || + exitCode == ApplicationMaster.EXIT_EARLY || + exitCode == ApplicationMaster.EXIT_UNCAUGHT_EXCEPTION) --- End diff -- Move this into a separate method ? Also, can we make it explicit in what the exitCode handled is `exitCode == EXIT_EXCEPTION_USER_CLASS || exitCode == v2 ..` instead of negation ?
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org