From ce54b7e55d912b2f8c34801209c86518cd4642e5 Mon Sep 17 00:00:00 2001 From: GuoPhilipse <46367746+GuoPhilipse@users.noreply.github.com> Date: Thu, 15 Sep 2022 00:53:25 +0800 Subject: [PATCH] HADOOP-18118. Fix KMS Accept Queue Size default value to 500 (#3972) --- .../src/main/java/org/apache/hadoop/http/HttpServer2.java | 2 +- .../test/java/org/apache/hadoop/http/TestHttpServer.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java index 934848b826..178f761191 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/http/HttpServer2.java +++ b/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"; diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java index 062033d4d5..b71610588c 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/http/TestHttpServer.java @@ -743,6 +743,13 @@ public void testBacklogSize() throws Exception 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;