tomscut commented on a change in pull request #3170:
URL: https://github.com/apache/hadoop/pull/3170#discussion_r711494952



##########
File path: 
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Server.java
##########
@@ -3192,23 +3196,41 @@ protected Server(String bindAddress, int port,
     if (queueSizePerHandler != -1) {
       this.maxQueueSize = handlerCount * queueSizePerHandler;
     } else {
-      this.maxQueueSize = handlerCount * conf.getInt(
-          CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
-          CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT);      
+      this.maxQueueSize = conf.getInt(getQueueClassPrefix() + "." +
+          CommonConfigurationKeys.SERVER_HANDLER_QUEUE_SIZE_KEY, 0);
+      if (this.maxQueueSize < 1) {
+        this.maxQueueSize = handlerCount * conf.getInt(
+            CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_KEY,
+            CommonConfigurationKeys.IPC_SERVER_HANDLER_QUEUE_SIZE_DEFAULT);
+      }
+    }
+    int tmpMaxRespSize = conf.getInt(getQueueClassPrefix() + "." +
+        CommonConfigurationKeys.SERVER_RPC_MAX_RESPONSE_SIZE_KEY, 0);
+    if (tmpMaxRespSize < 1) {
+      this.maxRespSize = conf.getInt(
+          CommonConfigurationKeys.IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY,
+          CommonConfigurationKeys.IPC_SERVER_RPC_MAX_RESPONSE_SIZE_DEFAULT);
+    } else {
+      this.maxRespSize = tmpMaxRespSize;
     }
-    this.maxRespSize = conf.getInt(
-        CommonConfigurationKeys.IPC_SERVER_RPC_MAX_RESPONSE_SIZE_KEY,
-        CommonConfigurationKeys.IPC_SERVER_RPC_MAX_RESPONSE_SIZE_DEFAULT);
     if (numReaders != -1) {
       this.readThreads = numReaders;
     } else {
-      this.readThreads = conf.getInt(
-          CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_KEY,
-          CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_DEFAULT);
+      this.readThreads = conf.getInt(getQueueClassPrefix() + "." +
+          CommonConfigurationKeys.SERVER_RPC_READ_THREADS_KEY, 0);

Review comment:
       Hi @jianghuazhu , if we share default value with 
```IPC_SERVER_RPC_READ_THREADS_KEY```, maybe we could change 
   ```
   this.readThreads = conf.getInt(getQueueClassPrefix() + "." +
             CommonConfigurationKeys.SERVER_RPC_READ_THREADS_KEY, 0);
   if (this.readThreads < 1) {
           this.readThreads = conf.getInt(
               CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_KEY,
               CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_DEFAULT);
   }
   ```
   to
   ```this.readThreads = conf.getInt(prefix + "." + 
CommonConfigurationKeys.SERVER_RPC_READ_THREADS_KEY, 
CommonConfigurationKeys.IPC_SERVER_RPC_READ_THREADS_DEFAULT);```. 
   
   What do you think?




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