You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by me...@apache.org on 2021/06/04 06:49:51 UTC
[hbase] branch branch-2.4 updated: HBASE-25930 Thrift does not
support requests in Kerberos environment (#3326)
This is an automated email from the ASF dual-hosted git repository.
meszibalu pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.4 by this push:
new 7102dd0 HBASE-25930 Thrift does not support requests in Kerberos environment (#3326)
7102dd0 is described below
commit 7102dd0654985364faca691d1cdc9a91bb5f4971
Author: Haoning Sun <ms...@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 <su...@qianxin.com>
Signed-off-by: Istvan Toth <st...@apache.org>
Signed-off-by: Balazs Meszaros <me...@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 fe417df..8beae8a 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;
@@ -97,6 +98,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;
@@ -844,15 +846,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;
}