pan3793 commented on code in PR #7249:
URL: https://github.com/apache/kyuubi/pull/7249#discussion_r2544322519
##########
externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/operation/ExecuteStatement.scala:
##########
@@ -120,12 +120,29 @@ class ExecuteStatement(
super.validateFetchOrientation(order)
}
+ override def cancel(): Unit = withLockRequired {
+ if (!isTerminalState(state)) {
+ setState(OperationState.CANCELED)
+ // TODO: If `shouldRunAsync` is true, the statement is initialized
lazily.
+ // When a SQL is submitted and immediately canceled, `jdbcStatement` may
still be null,
+ // which can lead to the cancellation not taking effect.
Review Comment:
let's add a warning message with opId for this case.
##########
externals/kyuubi-jdbc-engine/src/main/scala/org/apache/kyuubi/engine/jdbc/operation/ExecuteStatement.scala:
##########
@@ -120,12 +120,29 @@ class ExecuteStatement(
super.validateFetchOrientation(order)
}
+ override def cancel(): Unit = withLockRequired {
+ if (!isTerminalState(state)) {
+ setState(OperationState.CANCELED)
+ // TODO: If `shouldRunAsync` is true, the statement is initialized
lazily.
+ // When a SQL is submitted and immediately canceled, `jdbcStatement` may
still be null,
+ // which can lead to the cancellation not taking effect.
Review Comment:
let's add a warning log with opId for this case.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]