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 <[email protected]>

(cherry picked from 8a9ad07)
  • Loading branch information
qiuwei68 authored and wchevreuil committed Oct 13, 2023
1 parent e915e1c commit ef457ce
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,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 @@ -467,6 +472,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 ef457ce

Please sign in to comment.