浏览代码

HADOOP-18118. Fix KMS Accept Queue Size default value to 500 (#3972)

GuoPhilipse 2 年之前
父节点
当前提交
ce54b7e55d

+ 1 - 1
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java

@@ -144,7 +144,7 @@ public final class HttpServer2 implements FilterContainer {
 
   public static final String HTTP_SOCKET_BACKLOG_SIZE_KEY =
       "hadoop.http.socket.backlog.size";
-  public static final int HTTP_SOCKET_BACKLOG_SIZE_DEFAULT = 128;
+  public static final int HTTP_SOCKET_BACKLOG_SIZE_DEFAULT = 500;
   public static final String HTTP_MAX_THREADS_KEY = "hadoop.http.max.threads";
   public static final String HTTP_ACCEPTOR_COUNT_KEY =
       "hadoop.http.acceptor.count";

+ 7 - 0
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java

@@ -743,6 +743,13 @@ public class TestHttpServer extends HttpServerFunctionalTest {
     assertEquals(backlogSize, listener.getAcceptQueueSize());
   }
 
+  @Test
+  public void testBacklogSize2() throws Exception
+  {
+    Configuration conf = new Configuration();
+    assertEquals(500, conf.get(HttpServer2.HTTP_SOCKET_BACKLOG_SIZE_KEY));
+  }
+
   @Test
   public void testIdleTimeout() throws Exception {
     final int idleTimeout = 1000;