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:45:11 UTC

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

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



##########
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:
       As `remoteOpHanlde` is optional, can we use `Option` to represent it instead of testing whether being `null`?




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