You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/09 02:32:47 UTC

[GitHub] [spark] AngersZhuuuu commented on a change in pull request #29933: [SPARK-26533][SQL] Support query auto timeout cancel on thriftserver

AngersZhuuuu commented on a change in pull request #29933:
URL: https://github.com/apache/spark/pull/29933#discussion_r502146652



##########
File path: sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
##########
@@ -329,17 +339,21 @@ private[hive] class SparkExecuteStatementOperation(
     }
   }
 
-  override def cancel(): Unit = {
+  private def cancel(stateAfterCancel: OperationState): Unit = {
     synchronized {
       if (!getStatus.getState.isTerminal) {
         logInfo(s"Cancel query with $statementId")
-        setState(OperationState.CANCELED)
+        setState(stateAfterCancel)
         cleanup()
         HiveThriftServer2.eventManager.onStatementCanceled(statementId)

Review comment:
       One problem, if query timeout, we still call 
   ```
   HiveThriftServer2.eventManager.onStatementCanceled(statementId)
   ```
   then for timeout query, in spark thrift server ui, we still show it's cancelled,  we can't know this sql is timeout  directly.
   
   IMO, We need to separate these two states.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org