You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@livy.apache.org by GitBox <gi...@apache.org> on 2019/12/06 11:10:27 UTC

[GitHub] [incubator-livy] jahstreet commented on a change in pull request #242: [LIVY-336][SERVER] Livy should not spawn one thread per job to track the job on Yarn

jahstreet commented on a change in pull request #242: [LIVY-336][SERVER] Livy should not spawn one thread per job to track the job on Yarn
URL: https://github.com/apache/incubator-livy/pull/242#discussion_r354773674
 
 

 ##########
 File path: server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala
 ##########
 @@ -111,7 +152,48 @@ object SparkYarnApp extends Logging {
     }
   }
 
+  class YarnAppMonitorRunnable extends Runnable {
+    override def run(): Unit = {
+      var loop = true
+      while (loop) {
+        try {
+          // update time when monitor app so that
+          // checkMonitorAppTimeoutThread can check whether the thread was blocked on monitoring
+          monitorAppThreadMap.put(Thread.currentThread(), System.currentTimeMillis())
+
+          val app = appQueue.poll()
+          if (app != null) {
+            app.monitorSparkYarnApp()
 
+            if (app.isRunning) {
+              appQueue.add(app)
+            }
+          }
+
+          Thread.sleep(yarnPoolInterval)
+        } catch {
+          case e: InterruptedException =>
+            loop = false
+            error(s"YarnAppMonitorRunnable Exception whiling monitor", e)
 
 Review comment:
   ```suggestion
               error(s"Yarn app monitoring was interrupted.", e)
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services