You are viewing a plain text version of this content. The canonical link for it is here.
Posted to gitbox@hive.apache.org by "dengzhhu653 (via GitHub)" <gi...@apache.org> on 2023/05/15 12:59:34 UTC

[GitHub] [hive] dengzhhu653 commented on a diff in pull request #4322: HIVE-27340: ThreadPool in HS2 over HTTP should respect the customized…

dengzhhu653 commented on code in PR #4322:
URL: https://github.com/apache/hive/pull/4322#discussion_r1193801855


##########
service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpCLIService.java:
##########
@@ -94,7 +95,13 @@ protected void initServer() {
       String threadPoolName = "HiveServer2-HttpHandler-Pool";
       ThreadPoolExecutor executorService = new ThreadPoolExecutor(minWorkerThreads,
           maxWorkerThreads,workerKeepAliveTime, TimeUnit.SECONDS,
-          new SynchronousQueue<Runnable>(), new ThreadFactoryWithGarbageCleanup(threadPoolName));
+          new SynchronousQueue<Runnable>(), new ThreadFactoryWithGarbageCleanup(threadPoolName)) {
+        @Override
+        public void setThreadFactory(ThreadFactory threadFactory) {

Review Comment:
   Thanks for the comments. 
   In Jetty, the `ExecutorThreadPool` will override the `ThreadPoolExecutor`'s ThreadFactory:
   ```
    ((ThreadPoolExecutor)_executor).setThreadFactory(this::newThread);
   ```
   In our case, the `_executor` has already provided the ThreadFactory, so as a workaround, `_executor` needs to make the `setThreadFactory` empty, make this call take no effect.
   
   Perhaps we need to print some warn logs to indicate what's happening in this overriding method.



-- 
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: gitbox-unsubscribe@hive.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: gitbox-unsubscribe@hive.apache.org
For additional commands, e-mail: gitbox-help@hive.apache.org