You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@kyuubi.apache.org by GitBox <gi...@apache.org> on 2022/04/08 10:22:10 UTC

[GitHub] [incubator-kyuubi] lightning-L commented on a diff in pull request #2295: [KYUUBI #2250] Support to limit the spark engine max running time

lightning-L commented on code in PR #2295:
URL: https://github.com/apache/incubator-kyuubi/pull/2295#discussion_r845969698


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/util/ThreadUtils.scala:
##########
@@ -64,4 +64,21 @@ object ThreadUtils extends Logging {
         throw new KyuubiException("Exception thrown in awaitResult: ", e)
     }
   }
+
+  def shutdown(
+      executor: ExecutorService,
+      gracePeriod: Duration = FiniteDuration(30, TimeUnit.SECONDS)): Unit = {

Review Comment:
   This is the refactor for original code in SessionManager.scala#stop().
   And I also refered to the ThreadUtils.scala#shutdown in spark code, which has the default 30s for gracePeriod.
   
   To shut down the ExecutorService, we use shutdown() method combined with awaitTermination() method. With this approach, the ExecutorService will first stop taking new tasks and then wait up to a specified period of time for all tasks to be completed. If that time expires, the execution is stopped immediately.



-- 
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: notifications-unsubscribe@kyuubi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org