Skip to content

Commit c1ffc3c

Browse files
committed
[KYUUBI #2223] Return the last rows of log for prompts even exception detected
### _Why are the changes needed?_ The detected error might not be accurate, return the last rows of log anyway. ### _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 - [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #2223 from turboFei/detect_rc. Closes #2223 9e1b3c8 [Fei Wang] Return the last lgos anyway Authored-by: Fei Wang <fwang12@ebay.com> Signed-off-by: Fei Wang <fwang12@ebay.com>
1 parent 86cd685 commit c1ffc3c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,15 @@ trait ProcBuilder {
203203
if (error == UNCAUGHT_ERROR) {
204204
Thread.sleep(1000)
205205
}
206+
val lastLogRows = lastRowsOfLog.toArray.mkString("\n")
206207
error match {
207208
case UNCAUGHT_ERROR =>
208209
KyuubiSQLException(s"Failed to detect the root cause, please check $engineLog at server " +
209210
s"side if necessary. The last $engineLogMaxLines line(s) of log are:\n" +
210211
s"${lastRowsOfLog.toArray.mkString("\n")}")
211-
case other => other
212+
case other =>
213+
KyuubiSQLException(s"${Utils.stringifyException(other)}.\n" +
214+
s"FYI: The last $engineLogMaxLines line(s) of log are:\n$lastLogRows")
212215
}
213216
}
214217

0 commit comments

Comments
 (0)