juliuszsompolski 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_r319168681
 
 

 ##########
 File path: 
sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkExecuteStatementOperation.scala
 ##########
 @@ -275,6 +279,7 @@ private[hive] class SparkExecuteStatementOperation(
   override def cancel(): Unit = {
     logInfo(s"Cancel '$statement' with $statementId")
     cleanup(OperationState.CANCELED)
+    HiveThriftServer2.listener.onStatementCanceled(statementId)
 
 Review comment:
   This can call `onStatementCanceled()` before the thread launching 
`execute()` gets to `onStatementStarted()`, which will result in the listener 
throwing an NoSuchElementException on executionList(id).
   `onStatementStarted()` could be moved to `runInternal()` in the main thread 
to prevent that, but then the `catch` block there has to add 
`onStatementError()`. It then would also be good to extend the `try` block to 
the start of `execute()`

----------------------------------------------------------------
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]

Reply via email to