Skip to content

Commit 18a38ae

Browse files
qiuwei68wchevreuil
authored andcommitted
HBASE-28138 Make the connection idle timeout configurable for the embedded HTTP servers (#5457)
Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org> (cherry picked from commit 8a9ad07)
1 parent 212c7cb commit 18a38ae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

hbase-http/src/main/java/org/apache/hadoop/hbase/http/HttpServer.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ public class HttpServer implements FilterContainer {
114114
// limitation otherwise the UTs will fail
115115
private static final int DEFAULT_MAX_HEADER_SIZE = Character.MAX_VALUE - 1;
116116

117+
// Add configuration for jetty idle timeout
118+
private static final String HTTP_JETTY_IDLE_TIMEOUT = "hbase.ui.connection.idleTimeout";
119+
// Default jetty idle timeout
120+
private static final long DEFAULT_HTTP_JETTY_IDLE_TIMEOUT = 30000;
121+
117122
static final String FILTER_INITIALIZERS_PROPERTY = "hbase.http.filter.initializers";
118123
static final String HTTP_MAX_THREADS = "hbase.http.max.threads";
119124

@@ -465,6 +470,9 @@ public HttpServer build() throws IOException {
465470

466471
// default settings for connector
467472
listener.setAcceptQueueSize(128);
473+
// config idle timeout for jetty
474+
listener
475+
.setIdleTimeout(conf.getLong(HTTP_JETTY_IDLE_TIMEOUT, DEFAULT_HTTP_JETTY_IDLE_TIMEOUT));
468476
if (Shell.WINDOWS) {
469477
// result of setting the SO_REUSEADDR flag is different on Windows
470478
// http://msdn.microsoft.com/en-us/library/ms740621(v=vs.85).aspx

0 commit comments

Comments
 (0)