AngersZhuuuu commented on a change in pull request #25611: [SPARK-28901][SQL]
SparkThriftServer's Cancel SQL Operation show it in JDBC Tab UI
URL: https://github.com/apache/spark/pull/25611#discussion_r319740457
##########
File path:
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/HiveThriftServer2.scala
##########
@@ -258,7 +266,11 @@ object HiveThriftServer2 extends Logging {
def onOperationClosed(id: String): Unit = synchronized {
executionList(id).closeTimestamp = System.currentTimeMillis
+ val lastState = executionList(id).state
executionList(id).state = ExecutionState.CLOSED
+ if (lastState == ExecutionState.STARTED || lastState ==
ExecutionState.COMPILED) {
+ totalRunning -= 1
+ }
Review comment:
> does FINISHED need to be handled somewhere?
this place is to handle situation like : we have call close before finish,
then the totalRunning value should -1 too. If we call `cancel()` or it
finished, then when we call closeOperation, we won't do `totalRunning -= 1`.
Since for FINISHED, has do `totalRunning -= 1 `, so here don't need to contain
FINISHED
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]