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

[GitHub] [incubator-kyuubi] yaooqinn commented on a diff in pull request #2509: [KYUUBI #2490] Fix NPE in getOperationStatus

yaooqinn commented on code in PR #2509:
URL: https://github.com/apache/incubator-kyuubi/pull/2509#discussion_r861456936


##########
kyuubi-common/src/main/scala/org/apache/kyuubi/service/AbstractBackendService.scala:
##########
@@ -160,7 +160,18 @@ abstract class AbstractBackendService(name: String)
     val operation = sessionManager.operationManager.getOperation(operationHandle)
     if (operation.shouldRunAsync) {
       try {
-        operation.getBackgroundHandle.get(timeout, TimeUnit.MILLISECONDS)

Review Comment:
   the fix here is wrong, because operation.getBackgroundHandle is null forever
   
   ```diff
   +++ b/externals/kyuubi-hive-sql-engine/src/main/scala/org/apache/kyuubi/engine/hive/operation/ExecuteStatement.scala
   @@ -30,7 +30,7 @@ class ExecuteStatement(
        session: Session,
        override val statement: String,
        confOverlay: Map[String, String],
   -    override val shouldRunAsync: Boolean,
   +    runAsync: Boolean,
        queryTimeout: Long)
      extends HiveOperation(OperationType.EXECUTE_STATEMENT, session) {
   
   @@ -39,9 +39,11 @@ class ExecuteStatement(
          hive,
          statement,
          confOverlay.asJava,
   -      shouldRunAsync,
   +      runAsync,
          queryTimeout)
      }
   
      EventBus.post(HiveOperationEvent(this))
   +
   +  override def shouldRunAsync: Boolean = runAsync && getBackgroundHandle != 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: notifications-unsubscribe@kyuubi.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@kyuubi.apache.org
For additional commands, e-mail: notifications-help@kyuubi.apache.org