zuston commented on code in PR #2789:
URL: https://github.com/apache/uniffle/pull/2789#discussion_r3974910519


##########
common/src/main/java/org/apache/uniffle/common/rpc/GrpcServer.java:
##########
@@ -66,12 +67,24 @@ protected GrpcServer(
       RssBaseConf conf,
       List<Pair<BindableService, List<ServerInterceptor>>> 
servicesWithInterceptors,
       GRPCMetrics grpcMetrics) {
+    this(conf, servicesWithInterceptors, grpcMetrics, null);
+  }
+
+  private GrpcServer(
+      RssBaseConf conf,
+      List<Pair<BindableService, List<ServerInterceptor>>> 
servicesWithInterceptors,
+      GRPCMetrics grpcMetrics,
+      Integer threadPoolSize) {
     this.rssConf = conf;
     this.configuredPort = rssConf.getInteger(RssBaseConf.RPC_SERVER_PORT);
     this.servicesWithInterceptors = servicesWithInterceptors;
     this.grpcMetrics = grpcMetrics;
 
-    int rpcExecutorSize = conf.getInteger(RssBaseConf.RPC_EXECUTOR_SIZE);
+    Supplier<Integer> rpcExecutorSizeSupplier =
+        threadPoolSize == null
+            ? () -> conf.getInteger(RssBaseConf.RPC_EXECUTOR_SIZE)
+            : () -> threadPoolSize;
+    int rpcExecutorSize = rpcExecutorSizeSupplier.get();

Review Comment:
   ```
   int rpcExecutorSize = threadPoolSize == null
               ? conf.getInteger(RssBaseConf.RPC_EXECUTOR_SIZE)
               : threadPoolSize;
   ```



##########
common/src/main/java/org/apache/uniffle/common/rpc/GrpcServer.java:
##########
@@ -84,8 +97,8 @@ protected GrpcServer(
             grpcMetrics);
     ThreadPoolManager.registerThreadPool(
         "Grpc",
-        () -> conf.getInteger(RssBaseConf.RPC_EXECUTOR_SIZE),
-        () -> conf.getInteger(RssBaseConf.RPC_EXECUTOR_SIZE) * 2,
+        rpcExecutorSizeSupplier,

Review Comment:
   () -> xxx



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