This is an automated email from the ASF dual-hosted git repository.

elserj pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
     new e1131a2  HBASE-26767 Rest server should not use a large Header Cache.
e1131a2 is described below

commit e1131a2608f66972dceaf2a152ab77c6e8b0a3cf
Author: Sergey Soldatov <s...@apache.org>
AuthorDate: Wed Feb 23 15:29:37 2022 -0500

    HBASE-26767 Rest server should not use a large Header Cache.
    
    Closes #4123
    
    Co-authored-by: Tak Lon (Stephen) Wu <tak...@apache.org>
    Signed-off-by: Tak Lon (Stephen) Wu <tak...@apache.org>
    Signed-off-by: Josh Elser <els...@apache.org>
---
 .../src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java      | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git 
a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java 
b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
index 9ceef8c..4806b6d 100644
--- a/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
+++ b/hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/RESTServer.java
@@ -94,6 +94,8 @@ public class RESTServer implements Constants {
   static final String REST_CSRF_METHODS_TO_IGNORE_DEFAULT = 
"GET,OPTIONS,HEAD,TRACE";
   public static final String SKIP_LOGIN_KEY = "hbase.rest.skip.login";
   static final int DEFAULT_HTTP_MAX_HEADER_SIZE = 64 * 1024; // 64k
+  static final String HTTP_HEADER_CACHE_SIZE = 
"hbase.rest.http.header.cache.size";
+  static final int DEFAULT_HTTP_HEADER_CACHE_SIZE = Character.MAX_VALUE -1;
 
   private static final String PATH_SPEC_ANY = "/*";
 
@@ -294,10 +296,12 @@ public class RESTServer implements Constants {
 
     String host = servlet.getConfiguration().get("hbase.rest.host", "0.0.0.0");
     int servicePort = servlet.getConfiguration().getInt("hbase.rest.port", 
8080);
+    int httpHeaderCacheSize = 
servlet.getConfiguration().getInt(HTTP_HEADER_CACHE_SIZE,
+      DEFAULT_HTTP_HEADER_CACHE_SIZE);
     HttpConfiguration httpConfig = new HttpConfiguration();
     httpConfig.setSecureScheme("https");
     httpConfig.setSecurePort(servicePort);
-    httpConfig.setHeaderCacheSize(DEFAULT_HTTP_MAX_HEADER_SIZE);
+    httpConfig.setHeaderCacheSize(httpHeaderCacheSize);
     httpConfig.setRequestHeaderSize(DEFAULT_HTTP_MAX_HEADER_SIZE);
     httpConfig.setResponseHeaderSize(DEFAULT_HTTP_MAX_HEADER_SIZE);
     httpConfig.setSendServerVersion(false);

Reply via email to