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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to