You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by ni...@apache.org on 2022/04/20 16:13:54 UTC
[incubator-kyuubi] branch master updated: [KYUUBI #2426] Return complete error stack trace information
This is an automated email from the ASF dual-hosted git repository.
nicholasjiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-kyuubi.git
The following commit(s) were added to refs/heads/master by this push:
new deb0e6203 [KYUUBI #2426] Return complete error stack trace information
deb0e6203 is described below
commit deb0e6203b5b56a1c61162f793d3601be0395118
Author: Ada Wang <wa...@gmail.com>
AuthorDate: Thu Apr 21 00:13:41 2022 +0800
[KYUUBI #2426] Return complete error stack trace information
### _Why are the changes needed?_
Now lose error stack trace information.
### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible
- [ ] Add screenshots for manual tests if appropriate
- [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request
Closes #2428 from deadwind4/stack-trace-front.
Closes #2426
c7dde402 [Ada Wang] [KYUUBI #2426] Return complete error stack trace information
Authored-by: Ada Wang <wa...@gmail.com>
Signed-off-by: KenjiFujima <th...@gmail.com>
---
.../src/main/scala/org/apache/kyuubi/service/TFrontendService.scala | 3 ++-
.../test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala
index 13b938caa..7789ffb0a 100644
--- a/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala
+++ b/kyuubi-common/src/main/scala/org/apache/kyuubi/service/TFrontendService.scala
@@ -30,6 +30,7 @@ import org.apache.thrift.server.{ServerContext, TServerEventHandler}
import org.apache.thrift.transport.TTransport
import org.apache.kyuubi.{KyuubiSQLException, Logging, Utils}
+import org.apache.kyuubi.Utils.stringifyException
import org.apache.kyuubi.config.KyuubiConf.{FRONTEND_CONNECTION_URL_USE_HOSTNAME, FRONTEND_THRIFT_BINARY_BIND_HOST}
import org.apache.kyuubi.operation.{FetchOrientation, OperationHandle}
import org.apache.kyuubi.service.authentication.KyuubiAuthenticationFactory
@@ -423,7 +424,7 @@ abstract class TFrontendService(name: String)
operationStatus.exception.foreach { e =>
resp.setSqlState(e.getSQLState)
resp.setErrorCode(e.getErrorCode)
- resp.setErrorMessage(e.getMessage)
+ resp.setErrorMessage(stringifyException(e))
}
resp.setStatus(OK_STATUS)
} catch {
diff --git a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala
index af2d0f267..1f7ec181e 100644
--- a/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala
+++ b/kyuubi-common/src/test/scala/org/apache/kyuubi/service/TFrontendServiceSuite.scala
@@ -380,7 +380,8 @@ class TFrontendServiceSuite extends KyuubiFunSuite {
val resp4 = client.GetOperationStatus(req2)
assert(resp4.getStatus.getStatusCode === TStatusCode.SUCCESS_STATUS)
assert(resp4.getOperationState === TOperationState.ERROR_STATE)
- assert(resp4.getErrorMessage === "noop operation err")
+ assert(resp4.getErrorMessage startsWith "org.apache.kyuubi.KyuubiSQLException:" +
+ " noop operation err\n\tat org.apache.kyuubi.KyuubiSQLException")
}
}