You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kyuubi.apache.org by GitBox <gi...@apache.org> on 2021/10/29 04:47:58 UTC

[GitHub] [incubator-kyuubi] yaooqinn commented on a change in pull request #1312: [KYUUBI #1300] Detecting critical errors

yaooqinn commented on a change in pull request #1312:
URL: https://github.com/apache/incubator-kyuubi/pull/1312#discussion_r738929684



##########
File path: kyuubi-server/src/main/scala/org/apache/kyuubi/operation/KyuubiOperation.scala
##########
@@ -86,27 +87,37 @@ abstract class KyuubiOperation(
     }
   }
 
-  override def cancel(): Unit = {
-    if (_remoteOpHandle != null && !isClosedOrCanceled) {
-      try {
-        client.cancelOperation(_remoteOpHandle)
-        setState(OperationState.CANCELED)
-      } catch onError("cancelling")
+  override def cancel(): Unit = state.synchronized {
+    if (!isClosedOrCanceled) {
+      setState(OperationState.CANCELED)
+      if (_remoteOpHandle != null) {

Review comment:
       I have no strong option of that, null testing looks fine to me 




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

To unsubscribe, e-mail: commits-unsubscribe@kyuubi.apache.org

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