You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by fe...@apache.org on 2022/03/27 07:31:13 UTC

[incubator-kyuubi] branch master updated: [KYUUBI #2223] Return the last rows of log for prompts even exception detected

This is an automated email from the ASF dual-hosted git repository.

feiwang 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 c1ffc3c  [KYUUBI #2223] Return the last rows of log for prompts even exception detected
c1ffc3c is described below

commit c1ffc3ca6b8f06bd8d680d4b30b847145914c5cc
Author: Fei Wang <fw...@ebay.com>
AuthorDate: Sun Mar 27 15:31:04 2022 +0800

    [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
    
    9e1b3c8d [Fei Wang] Return the last lgos anyway
    
    Authored-by: Fei Wang <fw...@ebay.com>
    Signed-off-by: Fei Wang <fw...@ebay.com>
---
 .../src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala        | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
index 4fdf61b..c61f34c 100644
--- a/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
+++ b/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/ProcBuilder.scala
@@ -203,12 +203,15 @@ trait ProcBuilder {
     if (error == UNCAUGHT_ERROR) {
       Thread.sleep(1000)
     }
+    val lastLogRows = lastRowsOfLog.toArray.mkString("\n")
     error match {
       case UNCAUGHT_ERROR =>
         KyuubiSQLException(s"Failed to detect the root cause, please check $engineLog at server " +
           s"side if necessary. The last $engineLogMaxLines line(s) of log are:\n" +
           s"${lastRowsOfLog.toArray.mkString("\n")}")
-      case other => other
+      case other =>
+        KyuubiSQLException(s"${Utils.stringifyException(other)}.\n" +
+          s"FYI: The last $engineLogMaxLines line(s) of log are:\n$lastLogRows")
     }
   }