dengzhhu653 commented on code in PR #3530:
URL: https://github.com/apache/hive/pull/3530#discussion_r952126346
##########
service/src/java/org/apache/hive/service/server/HiveServer2.java:
##########
@@ -439,7 +439,10 @@ public synchronized void init(HiveConf hiveConf) {
}
// Add a shutdown hook for catching SIGTERM & SIGINT
- ShutdownHookManager.addShutdownHook(() -> graceful_stop());
+ long timeout = HiveConf.getTimeVar(getHiveConf(),
+ HiveConf.ConfVars.HIVE_SERVER2_GRACEFUL_STOP_TIMEOUT,
TimeUnit.SECONDS);
+ // Add extra time for releasing the resources
+ ShutdownHookManager.addGracefulShutDownHook(() -> graceful_stop(), timeout
+ 30);
Review Comment:
The extra seconds are for HiveServer2 calling stop(), which in turn
releasing resources, such as cancelling the running operations, cleaning local
files, etc.
Without it, the shutdown scripts will issue 'kill -9' to kill the
HiveServer2 directly when timeout, so the HiveServer2 may have no chance to
call stop...
--
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]