From commits-return-98761-archive-asf-public=cust-asf.ponee.io@hbase.apache.org Fri Jun 4 07:04:44 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-he-de.apache.org (mxout1-he-de.apache.org [95.216.194.37]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 95FC6180670 for ; Fri, 4 Jun 2021 09:04:44 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-he-de.apache.org (ASF Mail Server at mxout1-he-de.apache.org) with SMTP id 0580761786 for ; Fri, 4 Jun 2021 07:04:43 +0000 (UTC) Received: (qmail 8072 invoked by uid 500); 4 Jun 2021 07:04:43 -0000 Mailing-List: contact commits-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hbase.apache.org Delivered-To: mailing list commits@hbase.apache.org Received: (qmail 8059 invoked by uid 99); 4 Jun 2021 07:04:42 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 Jun 2021 07:04:42 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id BA81781A86; Fri, 4 Jun 2021 07:04:42 +0000 (UTC) Date: Fri, 04 Jun 2021 07:04:40 +0000 To: "commits@hbase.apache.org" Subject: [hbase] branch branch-2.2 updated: HBASE-25930 Thrift does not support requests in Kerberos environment (#3326) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <162279027815.21809.7154140600569612762@gitbox.apache.org> From: meszibalu@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: hbase X-Git-Refname: refs/heads/branch-2.2 X-Git-Reftype: branch X-Git-Oldrev: 2ec2a0a0f275546d5ee7621a2eabdece3429ca24 X-Git-Newrev: 3468c88ddd38cb3ea7c2dd89256c7873528e87e0 X-Git-Rev: 3468c88ddd38cb3ea7c2dd89256c7873528e87e0 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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 AuthorDate: Fri Jun 4 14:15:25 2021 +0800 HBASE-25930 Thrift does not support requests in Kerberos environment (#3326) Co-authored-by: sunhaoning Signed-off-by: Istvan Toth Signed-off-by: Balazs Meszaros --- .../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() { + @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; }