-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22837][SQL]Session timeout checker does not work in SessionManager. #20025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,11 +23,7 @@ | |
| import java.util.ArrayList; | ||
| import java.util.Date; | ||
| import java.util.Map; | ||
| import java.util.concurrent.ConcurrentHashMap; | ||
| import java.util.concurrent.Future; | ||
| import java.util.concurrent.LinkedBlockingQueue; | ||
| import java.util.concurrent.ThreadPoolExecutor; | ||
| import java.util.concurrent.TimeUnit; | ||
| import java.util.concurrent.*; | ||
|
|
||
| import org.apache.commons.io.FileUtils; | ||
| import org.apache.commons.logging.Log; | ||
|
|
@@ -79,35 +75,19 @@ public synchronized void init(HiveConf hiveConf) { | |
| initOperationLogRootDir(); | ||
| } | ||
| createBackgroundOperationPool(); | ||
| addService(operationManager); | ||
| super.init(hiveConf); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hmm, I think we revert keep this line too.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, we could keep super.init() here and remove initCompositeService in SparkSQLSessionManager.init(). thanks |
||
| } | ||
|
|
||
| private void createBackgroundOperationPool() { | ||
| int poolSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_THREADS); | ||
| LOG.info("HiveServer2: Background operation thread pool size: " + poolSize); | ||
| int poolQueueSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_WAIT_QUEUE_SIZE); | ||
| LOG.info("HiveServer2: Background operation thread wait queue size: " + poolQueueSize); | ||
| long keepAliveTime = HiveConf.getTimeVar( | ||
| hiveConf, ConfVars.HIVE_SERVER2_ASYNC_EXEC_KEEPALIVE_TIME, TimeUnit.SECONDS); | ||
| LOG.info( | ||
| "HiveServer2: Background operation thread keepalive time: " + keepAliveTime + " seconds"); | ||
|
|
||
| // Create a thread pool with #poolSize threads | ||
| // Threads terminate when they are idle for more than the keepAliveTime | ||
| // A bounded blocking queue is used to queue incoming operations, if #operations > poolSize | ||
| String threadPoolName = "HiveServer2-Background-Pool"; | ||
| backgroundOperationPool = new ThreadPoolExecutor(poolSize, poolSize, | ||
| keepAliveTime, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>(poolQueueSize), | ||
| new ThreadFactoryWithGarbageCleanup(threadPoolName)); | ||
| backgroundOperationPool.allowCoreThreadTimeOut(true); | ||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can keep this file unchanged. Looks like the hive thread pool is more flexible than the spark one.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, i will update it . Thanks! |
||
| checkInterval = HiveConf.getTimeVar( | ||
| hiveConf, ConfVars.HIVE_SERVER2_SESSION_CHECK_INTERVAL, TimeUnit.MILLISECONDS); | ||
| sessionTimeout = HiveConf.getTimeVar( | ||
| hiveConf, ConfVars.HIVE_SERVER2_IDLE_SESSION_TIMEOUT, TimeUnit.MILLISECONDS); | ||
| checkOperation = HiveConf.getBoolVar(hiveConf, | ||
| ConfVars.HIVE_SERVER2_IDLE_SESSION_CHECK_OPERATION); | ||
| addService(operationManager); | ||
| } | ||
|
|
||
| private void createBackgroundOperationPool() { | ||
| int backgroundPoolSize = hiveConf.getIntVar(ConfVars.HIVE_SERVER2_ASYNC_EXEC_THREADS); | ||
| backgroundOperationPool = (ThreadPoolExecutor) Executors.newFixedThreadPool(backgroundPoolSize); | ||
| LOG.info("HiveServer2: Async execution pool size: " + backgroundPoolSize); | ||
| } | ||
|
|
||
| private void initOperationLogRootDir() { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
revert this back.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, thanks