Github user andrewor14 commented on a diff in the pull request:
https://github.com/apache/spark/pull/5297#discussion_r27697838
--- Diff: yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala ---
@@ -616,17 +620,29 @@ private[spark] class Client(
* throw an appropriate SparkException.
*/
def run(): Unit = {
- val (yarnApplicationState, finalApplicationStatus) =
monitorApplication(submitApplication())
- if (yarnApplicationState == YarnApplicationState.FAILED ||
- finalApplicationStatus == FinalApplicationStatus.FAILED) {
- throw new SparkException("Application finished with failed status")
- }
- if (yarnApplicationState == YarnApplicationState.KILLED ||
- finalApplicationStatus == FinalApplicationStatus.KILLED) {
- throw new SparkException("Application is killed")
- }
- if (finalApplicationStatus == FinalApplicationStatus.UNDEFINED) {
- throw new SparkException("The final status of application is
undefined")
+ val appId = submitApplication()
+ if (fireAndForget) {
+ logInfo("... polling ResourceManager for application state")
--- End diff --
This isn't actually polling. It's just requesting the application report
once and logs it, which isn't particularly useful for the user because s/he
will have no idea whether the application has even been successfully launched.
A better way would be to do what standalone mode does this, which is keep
requesting the status until it is running or has failed. I believe we can
already do this with `monitorApplication(appId, returnOnRunning = true)`.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]