From e79b59d9d1c967a5c80a4eb9fe0e44584a4dadac Mon Sep 17 00:00:00 2001 From: LiuGuoHua <129264181+sjgllgh@users.noreply.github.com> Date: Tue, 16 Jan 2024 21:50:17 +0800 Subject: [PATCH] fix the HBase command reports an error, but the client returns success (#5065) * Remove the EC lifespan restriction parameter. * If the command result contains "ERROR," the execution outcome is considered a failure. * To prevent the inclusion of the "ERROR" field in the query results, add an additional filtering condition --- .../manager/engineplugin/hbase/shell/HBaseShellSession.java | 3 +++ .../hbase-core/src/main/resources/linkis-engineconn.properties | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/linkis-engineconn-plugins/hbase/hbase-core/src/main/java/org/apache/linkis/manager/engineplugin/hbase/shell/HBaseShellSession.java b/linkis-engineconn-plugins/hbase/hbase-core/src/main/java/org/apache/linkis/manager/engineplugin/hbase/shell/HBaseShellSession.java index a0aef55797..af61eab186 100644 --- a/linkis-engineconn-plugins/hbase/hbase-core/src/main/java/org/apache/linkis/manager/engineplugin/hbase/shell/HBaseShellSession.java +++ b/linkis-engineconn-plugins/hbase/hbase-core/src/main/java/org/apache/linkis/manager/engineplugin/hbase/shell/HBaseShellSession.java @@ -271,6 +271,9 @@ private Result executeCmd(String cmd) { if (StringUtils.isBlank(res) && o != null) { res = o.toString(); } + if (res.contains("ERROR: ") && res.contains("For usage try 'help")) { + return Result.failed(getStackTrace(new Throwable(new Exception(res))), new Exception(res)); + } return Result.ok(res); } catch (Exception e) { return Result.failed(getStackTrace(e), e); diff --git a/linkis-engineconn-plugins/hbase/hbase-core/src/main/resources/linkis-engineconn.properties b/linkis-engineconn-plugins/hbase/hbase-core/src/main/resources/linkis-engineconn.properties index a3f4a74de3..674d7be02e 100644 --- a/linkis-engineconn-plugins/hbase/hbase-core/src/main/resources/linkis-engineconn.properties +++ b/linkis-engineconn-plugins/hbase/hbase-core/src/main/resources/linkis-engineconn.properties @@ -21,4 +21,4 @@ wds.linkis.engineconn.plugin.default.class=org.apache.linkis.manager.engineplugi #wds.linkis.engine.io.opts=" -Dfile.encoding=UTF-8 -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=49100 " wds.linkis.engineconn.support.parallelism=true wds.linkis.rpc.cache.expire.time=0 -wds.linkis.engineconn.max.free.time=0 \ No newline at end of file +#wds.linkis.engineconn.max.free.time=0 \ No newline at end of file