hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meszib...@apache.org
Subject [hbase] branch branch-2.2 updated: HBASE-25930 Thrift does not support requests in Kerberos environment (#3326)
Date Fri, 04 Jun 2021 07:04:40 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/branch-2.2 by this push:
     new 3468c88  HBASE-25930 Thrift does not support requests in Kerberos environment (#3326)
3468c88 is described below

commit 3468c88ddd38cb3ea7c2dd89256c7873528e87e0
Author: Haoning Sun <msunhaoning@163.com>
AuthorDate: Fri Jun 4 14:15:25 2021 +0800

    HBASE-25930 Thrift does not support requests in Kerberos environment (#3326)
    
    Co-authored-by: sunhaoning <sunhaoning@qianxin.com>
    Signed-off-by: Istvan Toth <stoty@apache.org>
    Signed-off-by: Balazs Meszaros <meszibalu@apache.org>
---
 .../apache/hadoop/hbase/thrift/ThriftServer.java   | 25 ++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
index 92e2d48..9301645 100644
--- a/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
+++ b/hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java
@@ -78,6 +78,7 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
 import java.net.UnknownHostException;
+import java.security.PrivilegedAction;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.BlockingQueue;
@@ -98,6 +99,7 @@ import org.apache.hadoop.hbase.HBaseInterfaceAudience;
 import org.apache.hadoop.hbase.filter.ParseFilter;
 import org.apache.hadoop.hbase.http.HttpServerUtil;
 import org.apache.hadoop.hbase.http.InfoServer;
+import org.apache.hadoop.hbase.log.HBaseMarkers;
 import org.apache.hadoop.hbase.security.SaslUtil;
 import org.apache.hadoop.hbase.security.SecurityUtil;
 import org.apache.hadoop.hbase.security.UserProvider;
@@ -845,15 +847,30 @@ public class ThriftServer  extends Configured implements Tool {
   public int run(String[] strings) throws Exception {
     processOptions(strings);
     setupParamters();
-    startInfoServer();
     if (httpEnabled) {
       setupHTTPServer();
-      httpServer.start();
-      httpServer.join();
     } else {
       setupServer();
-      tserver.serve();
     }
+    serviceUGI.doAs(new PrivilegedAction<Object>() {
+      @Override
+      public Object run() {
+        try {
+          startInfoServer();
+          if (httpEnabled) {
+            httpServer.start();
+            httpServer.join();
+          } else {
+            tserver.serve();
+          }
+        } catch (Exception e) {
+          LOG.error(HBaseMarkers.FATAL, "Cannot run ThriftServer", e);
+
+          System.exit(-1);
+        }
+        return null;
+      }
+    });
     return 0;
   }
 

Mime
View raw message