-
Notifications
You must be signed in to change notification settings - Fork 28.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SPARK-20345][SQL] Fix STS error handling logic on HiveSQLException #17643
Conversation
Test build #75826 has finished for PR 17643 at commit
|
@@ -253,6 +253,8 @@ private[hive] class SparkExecuteStatementOperation( | |||
return | |||
} else { | |||
setState(OperationState.ERROR) | |||
HiveThriftServer2.listener.onStatementError( | |||
statementId, e.getMessage, SparkUtils.exceptionString(e)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same logic like line 265.
Test build #77553 has finished for PR 17643 at commit
|
Hi, @gatorsmile . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
retest this please |
Thank you for review, @gatorsmile ! |
Test build #77945 has finished for PR 17643 at commit
|
## What changes were proposed in this pull request? [SPARK-5100](343d3bf) added Spark Thrift Server(STS) UI and the following logic to handle exceptions on case `Throwable`. ```scala HiveThriftServer2.listener.onStatementError( statementId, e.getMessage, SparkUtils.exceptionString(e)) ``` However, there occurred a missed case after implementing [SPARK-6964](eb19d3f75cbd002f7e72ce02017a8de67f562792)'s `Support Cancellation in the Thrift Server` by adding case `HiveSQLException` before case `Throwable`. ```scala case e: HiveSQLException => if (getStatus().getState() == OperationState.CANCELED) { return } else { setState(OperationState.ERROR) throw e } // Actually do need to catch Throwable as some failures don't inherit from Exception and // HiveServer will silently swallow them. case e: Throwable => val currentState = getStatus().getState() logError(s"Error executing query, currentState $currentState, ", e) setState(OperationState.ERROR) HiveThriftServer2.listener.onStatementError( statementId, e.getMessage, SparkUtils.exceptionString(e)) throw new HiveSQLException(e.toString) ``` Logically, we had better add `HiveThriftServer2.listener.onStatementError` on case `HiveSQLException`, too. ## How was this patch tested? N/A Author: Dongjoon Hyun <dongjoon@apache.org> Closes #17643 from dongjoon-hyun/SPARK-20345. (cherry picked from commit 32818d9) Signed-off-by: Xiao Li <gatorsmile@gmail.com>
Thanks! Merging to master/2.2 |
Thank you so much! |
## What changes were proposed in this pull request? [SPARK-5100](apache@343d3bf) added Spark Thrift Server(STS) UI and the following logic to handle exceptions on case `Throwable`. ```scala HiveThriftServer2.listener.onStatementError( statementId, e.getMessage, SparkUtils.exceptionString(e)) ``` However, there occurred a missed case after implementing [SPARK-6964](apache@eb19d3f75cbd002f7e72ce02017a8de67f562792)'s `Support Cancellation in the Thrift Server` by adding case `HiveSQLException` before case `Throwable`. ```scala case e: HiveSQLException => if (getStatus().getState() == OperationState.CANCELED) { return } else { setState(OperationState.ERROR) throw e } // Actually do need to catch Throwable as some failures don't inherit from Exception and // HiveServer will silently swallow them. case e: Throwable => val currentState = getStatus().getState() logError(s"Error executing query, currentState $currentState, ", e) setState(OperationState.ERROR) HiveThriftServer2.listener.onStatementError( statementId, e.getMessage, SparkUtils.exceptionString(e)) throw new HiveSQLException(e.toString) ``` Logically, we had better add `HiveThriftServer2.listener.onStatementError` on case `HiveSQLException`, too. ## How was this patch tested? N/A Author: Dongjoon Hyun <dongjoon@apache.org> Closes apache#17643 from dongjoon-hyun/SPARK-20345.
What changes were proposed in this pull request?
SPARK-5100 added Spark Thrift Server(STS) UI and the following logic to handle exceptions on case
Throwable
.However, there occurred a missed case after implementing SPARK-6964's
Support Cancellation in the Thrift Server
by adding caseHiveSQLException
before caseThrowable
.Logically, we had better add
HiveThriftServer2.listener.onStatementError
on caseHiveSQLException
, too.How was this patch tested?
N/A