runzhiwang 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_r351624126
########## File path: server/src/main/scala/org/apache/livy/utils/SparkYarnApp.scala ########## @@ -98,7 +118,36 @@ object SparkYarnApp extends Logging { } } + val yarnAppMonitorThreadPool: ExecutorService = + Executors.newFixedThreadPool(yarnAppMonitorThreadPoolSize) + + for (i <- 0 until yarnAppMonitorThreadPoolSize) { + yarnAppMonitorThreadPool.execute(new Runnable { + override def run(): Unit = { + var loop = true + try { + while (loop) { + val app = appQueue.poll() + if (app != null) { + app.monitorSparkYarnApp() Review comment: @jerryshao @yiheng I add `checkMonitorAppTimeoutThread ` to check whether `monitorSparkYarnApp ` was blocked. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services