You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by zh...@apache.org on 2023/05/15 02:51:18 UTC
[hbase] 02/03: HBASE-27865 TestThriftServerCmdLine fails with org.apache.hadoop.hbase.SystemExitRule (#5238)
This is an automated email from the ASF dual-hosted git repository.
zhangduo pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git
commit 4169b617661ebaf76ca194a370fe33c246487467
Author: Duo Zhang <zh...@apache.org>
AuthorDate: Mon May 15 10:35:24 2023 +0800
HBASE-27865 TestThriftServerCmdLine fails with org.apache.hadoop.hbase.SystemExitRule (#5238)
Signed-off-by: Liangjun He <he...@apache.org>
Signed-off-by: Xin Sun <dd...@gmail.com>
(cherry picked from commit fd4f984d87dc189f7afc6ddc50d5373e23b46ad5)
---
.../main/java/org/apache/hadoop/hbase/thrift/ThriftServer.java | 10 ++++------
1 file changed, 4 insertions(+), 6 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 5c70fc2ebc4..5777573e6f3 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
@@ -832,9 +832,9 @@ public class ThriftServer extends Configured implements Tool {
} else {
setupServer();
}
- serviceUGI.doAs(new PrivilegedAction<Object>() {
+ return serviceUGI.doAs(new PrivilegedAction<Integer>() {
@Override
- public Object run() {
+ public Integer run() {
try {
startInfoServer();
if (httpEnabled) {
@@ -843,15 +843,13 @@ public class ThriftServer extends Configured implements Tool {
} else {
tserver.serve();
}
+ return 0;
} catch (Exception e) {
LOG.error(HBaseMarkers.FATAL, "Cannot run ThriftServer", e);
-
- System.exit(-1);
+ return -1;
}
- return null;
}
});
- return 0;
}
public static void main(String[] args) throws Exception {