jeff-xu-z commented on code in PR #358:
URL: https://github.com/apache/incubator-livy/pull/358#discussion_r1000987512


##########
server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala:
##########
@@ -282,34 +286,45 @@ class SparkYarnApp private[utils] (
         try {
           Clock.sleep(pollInterval.toMillis)
 
-          // Refresh application state
-          val appReport = yarnClient.getApplicationReport(appId)
-          yarnDiagnostics = getYarnDiagnostics(appReport)
-          changeState(mapYarnState(
-            appReport.getApplicationId,
-            appReport.getYarnApplicationState,
-            appReport.getFinalApplicationStatus))
-
-          if (isProcessErrExit()) {
-            if (killed) {
-              changeState(SparkApp.State.KILLED)
-            } else {
-              changeState(SparkApp.State.FAILED)
+          if (!isProcessAlive()) {

Review Comment:
   @rliuamzn Correct, a Livy batch is supposed to wait for the spark-submit 
process launched by the Livy batch to complete before the batch can change its 
state. If the spark-submit is alive, the monitoring thread should be in the 
loop of "check if still alive, sleep if so". This should be the right logic.



-- 
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]

Reply via email to