Skip to content

Commit 34b7680

Browse files
author
zuotingbing
committed
[SPARK-22837][SQL]Session timeout checker does not work in SessionManager.
1 parent 6129ffa commit 34b7680

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/session/SessionManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,15 @@ public synchronized void start() {
148148
}
149149
}
150150

151+
private void initSessionTimeoutCheckerConfig() {
152+
checkInterval = HiveConf.getTimeVar(
153+
hiveConf, ConfVars.HIVE_SERVER2_SESSION_CHECK_INTERVAL, TimeUnit.MILLISECONDS);
154+
sessionTimeout = HiveConf.getTimeVar(
155+
hiveConf, ConfVars.HIVE_SERVER2_IDLE_SESSION_TIMEOUT, TimeUnit.MILLISECONDS);
156+
checkOperation = HiveConf.getBoolVar(hiveConf,
157+
ConfVars.HIVE_SERVER2_IDLE_SESSION_CHECK_OPERATION);
158+
}
159+
151160
private void startTimeoutChecker() {
152161
final long interval = Math.max(checkInterval, 3000L); // minimum 3 seconds
153162
Runnable timeoutChecker = new Runnable() {

sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLSessionManager.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ private[hive] class SparkSQLSessionManager(hiveServer: HiveServer2, sqlContext:
4242
override def init(hiveConf: HiveConf) {
4343
setSuperField(this, "hiveConf", hiveConf)
4444

45+
invoke(classOf[SessionManager], this, "initSessionTimeoutCheckerConfig")
46+
4547
// Create operation log root directory, if operation logging is enabled
4648
if (hiveConf.getBoolVar(ConfVars.HIVE_SERVER2_LOGGING_OPERATION_ENABLED)) {
4749
invoke(classOf[SessionManager], this, "initOperationLogRootDir")

0 commit comments

Comments
 (0)