Skip to content

Commit

Permalink
HBASE-28138 Make the connection idle timeout configurable for the emb…
Browse files Browse the repository at this point in the history
…edded HTTP servers (#5457)

Signed-off-by: Wellington Chevreuil <wchevreuil@apache.org>

(cherry picked from commit 8a9ad07)
  • Loading branch information
qiuwei68 authored and wchevreuil committed Oct 13, 2023
1 parent 212c7cb commit 18a38ae
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,11 @@ public class HttpServer implements FilterContainer {
// limitation otherwise the UTs will fail
private static final int DEFAULT_MAX_HEADER_SIZE = Character.MAX_VALUE - 1;

// Add configuration for jetty idle timeout
private static final String HTTP_JETTY_IDLE_TIMEOUT = "hbase.ui.connection.idleTimeout";
// Default jetty idle timeout
private static final long DEFAULT_HTTP_JETTY_IDLE_TIMEOUT = 30000;

static final String FILTER_INITIALIZERS_PROPERTY = "hbase.http.filter.initializers";
static final String HTTP_MAX_THREADS = "hbase.http.max.threads";

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

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

0 comments on commit 18a38ae

Please sign in to comment.