github-advanced-security[bot] commented on code in PR #19271:
URL: https://github.com/apache/druid/pull/19271#discussion_r3046711242


##########
server/src/main/java/org/apache/druid/server/initialization/ServerConfig.java:
##########
@@ -441,6 +442,17 @@
     return Math.max(10, (JvmUtils.getRuntimeInfo().getAvailableProcessors() * 
17) / 16 + 2) + 30;
   }
 
+  public static int getNumThreadsFromProperties(Properties properties)
+  {
+    final String value = 
properties.getProperty("druid.server.http.numThreads");
+    return value == null ? getDefaultNumThreads() : Integer.parseInt(value);

Review Comment:
   ## CodeQL / Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10956)



##########
services/src/main/java/org/apache/druid/cli/CliCoordinator.java:
##########
@@ -229,6 +231,19 @@
             binder.bind(JettyServerInitializer.class)
                   .to(CoordinatorJettyServerInitializer.class);
 
+            // QoS filtering to prevent heavy coordinator API requests from 
starving health check endpoints.
+            // Set druid.coordinator.server.maxConcurrentRequests=-1 to 
disable.
+            final int serverHttpNumThreads = 
ServerConfig.getNumThreadsFromProperties(properties);
+            final int maxConcurrentRequests = 
properties.containsKey("druid.coordinator.server.maxConcurrentRequests")
+                    ? 
Integer.parseInt(properties.getProperty("druid.coordinator.server.maxConcurrentRequests"))

Review Comment:
   ## CodeQL / Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10957)



##########
services/src/main/java/org/apache/druid/cli/CliOverlord.java:
##########
@@ -490,27 +489,17 @@
             Jerseys.addResource(binder, OverlordDataSourcesResource.class);
 
 
-            final int serverHttpNumThreads = 
properties.containsKey(CliIndexerServerModule.SERVER_HTTP_NUM_THREADS_PROPERTY)
-                                             ? 
Integer.parseInt(properties.getProperty(CliIndexerServerModule.SERVER_HTTP_NUM_THREADS_PROPERTY))
-                                             : 
ServerConfig.getDefaultNumThreads();
-
-            final int maxConcurrentActions;
-            if 
(properties.containsKey("druid.indexer.server.maxConcurrentActions")) {
-              maxConcurrentActions = 
Integer.parseInt(properties.getProperty("druid.indexer.server.maxConcurrentActions"));
-            } else {
-              maxConcurrentActions = 
getDefaultMaxConcurrentActions(serverHttpNumThreads);
-            }
-
+            // QoS filtering to prevent action requests from starving health 
check endpoints.
+            // Set druid.indexer.server.maxConcurrentActions=-1 to disable.
+            final int serverHttpNumThreads = 
ServerConfig.getNumThreadsFromProperties(properties);
+            final int maxConcurrentActions = 
properties.containsKey("druid.indexer.server.maxConcurrentActions")
+                ? 
Integer.parseInt(properties.getProperty("druid.indexer.server.maxConcurrentActions"))

Review Comment:
   ## CodeQL / Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more 
details](https://github.com/apache/druid/security/code-scanning/10958)



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