cryptoe commented on code in PR #18033:
URL: https://github.com/apache/druid/pull/18033#discussion_r2108888824


##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:
##########
@@ -196,24 +196,23 @@ static Server makeAndInitializeServer(
     // that concurrently handle the requests".
     int numServerThreads = config.getNumThreads() + 
getMaxJettyAcceptorsSelectorsNum(node);
 
-    final QueuedThreadPool threadPool;
     if (config.getQueueSize() == Integer.MAX_VALUE) {
-      threadPool = new QueuedThreadPool();
-      threadPool.setMinThreads(numServerThreads);
-      threadPool.setMaxThreads(numServerThreads);
+      jettyServerThreadPool = new QueuedThreadPool();
+      jettyServerThreadPool.setMinThreads(numServerThreads);
+      jettyServerThreadPool.setMaxThreads(numServerThreads);
     } else {
-      threadPool = new QueuedThreadPool(
+      jettyServerThreadPool = new QueuedThreadPool(
           numServerThreads,
           numServerThreads,
           60000, // same default is used in other case when threadPool = new 
QueuedThreadPool()
           new LinkedBlockingQueue<>(config.getQueueSize())
       );
     }
 
-    threadPool.setDaemon(true);
-    jettyServerThreadPool = threadPool;
+    jettyServerThreadPool.setDaemon(true);

Review Comment:
   Fixed the jettyServerPool to get initialized in one go with the relevant 
metric name. 
   
   The deamon stuff should not effect the monitor emitting metrics. 
   Yeah there is a race here. Agreed we can fix it as part of another PR. 
    



##########
server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java:
##########
@@ -196,24 +196,23 @@ static Server makeAndInitializeServer(
     // that concurrently handle the requests".
     int numServerThreads = config.getNumThreads() + 
getMaxJettyAcceptorsSelectorsNum(node);
 
-    final QueuedThreadPool threadPool;
     if (config.getQueueSize() == Integer.MAX_VALUE) {
-      threadPool = new QueuedThreadPool();
-      threadPool.setMinThreads(numServerThreads);
-      threadPool.setMaxThreads(numServerThreads);
+      jettyServerThreadPool = new QueuedThreadPool();
+      jettyServerThreadPool.setMinThreads(numServerThreads);
+      jettyServerThreadPool.setMaxThreads(numServerThreads);
     } else {
-      threadPool = new QueuedThreadPool(
+      jettyServerThreadPool = new QueuedThreadPool(
           numServerThreads,
           numServerThreads,
           60000, // same default is used in other case when threadPool = new 
QueuedThreadPool()
           new LinkedBlockingQueue<>(config.getQueueSize())
       );
     }
 
-    threadPool.setDaemon(true);
-    jettyServerThreadPool = threadPool;
+    jettyServerThreadPool.setDaemon(true);

Review Comment:
   Fixed the jettyServerPool to get initialized in one go with the relevant 
threads.
   
   The deamon stuff should not effect the monitor emitting metrics. 
   Yeah there is a race here. Agreed we can fix it as part of another PR. 
    



-- 
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