[KYUUBI #2078] logCaptureThread does not catch sparksubmit exception
Some checks failed
Kyuubi / Check License (push) Has been cancelled
Kyuubi / Build (11, -DskipTests -Pspark-provided, 3.1, 3.2) (push) Has been cancelled
Kyuubi / Build (8, -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.0.3 -Dspark.archive.name=spark-3.0.3-bin-hadoop2.7.tgz -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DeltaTest,org.apac… (push) Has been cancelled
Kyuubi / Build (8, -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.2.0 -Dspark.archive.name=spark-3.2.0-bin-hadoop3.2.tgz -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DeltaTest,org.apac… (push) Has been cancelled
Kyuubi / Build (8, 3.0, 2.7) (push) Has been cancelled
Kyuubi / Build (8, 3.2, 3.2) (push) Has been cancelled
Kyuubi / Build (true, 8, 3.1, 3.2) (push) Has been cancelled
Kyuubi / TPC-DS Tests (push) Has been cancelled
Kyuubi / Minikube Integration Test (push) Has been cancelled
Some checks failed
Kyuubi / Check License (push) Has been cancelled
Kyuubi / Build (11, -DskipTests -Pspark-provided, 3.1, 3.2) (push) Has been cancelled
Kyuubi / Build (8, -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.0.3 -Dspark.archive.name=spark-3.0.3-bin-hadoop2.7.tgz -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DeltaTest,org.apac… (push) Has been cancelled
Kyuubi / Build (8, -Dspark.archive.mirror=https://archive.apache.org/dist/spark/spark-3.2.0 -Dspark.archive.name=spark-3.2.0-bin-hadoop3.2.tgz -Dmaven.plugin.scalatest.exclude.tags=org.apache.kyuubi.tags.ExtendedSQLTest,org.apache.kyuubi.tags.DeltaTest,org.apac… (push) Has been cancelled
Kyuubi / Build (8, 3.0, 2.7) (push) Has been cancelled
Kyuubi / Build (8, 3.2, 3.2) (push) Has been cancelled
Kyuubi / Build (true, 8, 3.1, 3.2) (push) Has been cancelled
Kyuubi / TPC-DS Tests (push) Has been cancelled
Kyuubi / Minikube Integration Test (push) Has been cancelled
### _Why are the changes needed?_
`logCaptureThread` does not catch sparksubmit exception.
### _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 #2090 from SteNicholas/KYUUBI-2078.
Closes #2078
11ff6824 [SteNicholas] [KYUUBI #2078] logCaptureThread does not catch sparksubmit exception
Authored-by: SteNicholas <programgeek@163.com>
Signed-off-by: Kent Yao <yao@apache.org>
(cherry picked from commit cf014ee282)
Signed-off-by: Kent Yao <yao@apache.org>
This commit is contained in:
parent
89cc77b0d1
commit
18c422b6ba
@ -123,14 +123,14 @@ trait ProcBuilder {
|
|||||||
val maxErrorSize = conf.get(KyuubiConf.ENGINE_ERROR_MAX_SIZE)
|
val maxErrorSize = conf.get(KyuubiConf.ENGINE_ERROR_MAX_SIZE)
|
||||||
while (true) {
|
while (true) {
|
||||||
if (reader.ready()) {
|
if (reader.ready()) {
|
||||||
var line: String = reader.readLine
|
var line: String = reader.readLine.trim
|
||||||
if (containsIgnoreCase(line, "Exception:") &&
|
if (containsException(line) &&
|
||||||
!line.contains("at ") && !line.startsWith("Caused by:")) {
|
!line.contains("at ") && !line.startsWith("Caused by:")) {
|
||||||
val sb = new StringBuilder(line)
|
val sb = new StringBuilder(line)
|
||||||
error = KyuubiSQLException(sb.toString() + s"\n See more: $engineLog")
|
error = KyuubiSQLException(sb.toString() + s"\n See more: $engineLog")
|
||||||
line = reader.readLine()
|
line = reader.readLine().trim
|
||||||
while (sb.length < maxErrorSize && line != null &&
|
while (sb.length < maxErrorSize && line != null &&
|
||||||
(containsIgnoreCase(line, "Exception:") ||
|
(containsException(line) ||
|
||||||
line.startsWith("\tat ") ||
|
line.startsWith("\tat ") ||
|
||||||
line.startsWith("Caused by: "))) {
|
line.startsWith("Caused by: "))) {
|
||||||
sb.append("\n" + line)
|
sb.append("\n" + line)
|
||||||
@ -201,6 +201,9 @@ trait ProcBuilder {
|
|||||||
case other => other
|
case other => other
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private def containsException(log: String): Boolean =
|
||||||
|
containsIgnoreCase(log, "Exception:") || containsIgnoreCase(log, "Exception in thread")
|
||||||
}
|
}
|
||||||
|
|
||||||
object ProcBuilder extends Logging {
|
object ProcBuilder extends Logging {
|
||||||
|
|||||||
@ -95,6 +95,16 @@ class SparkProcessBuilderSuite extends KerberizedTestHelper {
|
|||||||
assert(error1.getMessage.contains("See more: "))
|
assert(error1.getMessage.contains("See more: "))
|
||||||
assert(!error1.getMessage.contains(msg), "stack trace shall be truncated")
|
assert(!error1.getMessage.contains(msg), "stack trace shall be truncated")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val pb3 =
|
||||||
|
new SparkProcessBuilder("kentyao", conf.set("spark.kerberos.principal", testPrincipal))
|
||||||
|
pb3.start
|
||||||
|
eventually(timeout(90.seconds), interval(500.milliseconds)) {
|
||||||
|
val error1 = pb3.getError
|
||||||
|
assert(!error1.getMessage.contains("Failed to detect the root cause"))
|
||||||
|
assert(error1.getMessage.contains("See more: "))
|
||||||
|
assert(error1.getMessage.contains("Exception in thread"))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
test("proxy user or keytab") {
|
test("proxy user or keytab") {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user