Skip to content

[FEATURE] Let clients receive feedback when KyuubiOperation is cancelled or closed failed #7253

@ruanwenjun

Description

@ruanwenjun

Code of Conduct

Search before asking

  • I have searched in the issues and found no similar issues.

Describe the feature

When we close or cancel a KyuubiStatement, an RPC request is sent to the Kyuubi server.
The server handles the close/cancel on the related session, and will emit the result if the cancel or close operation fails on the engine.

def cancelOperation(operationHandle: TOperationHandle): Unit = {
    val req = new TCancelOperationReq(operationHandle)
    val resp = withLockAcquiredAsyncRequest(CancelOperation(req))
    if (resp.getStatus.getStatusCode == TStatusCode.SUCCESS_STATUS) {
      info(s"$req succeed on engine side")
    } else {
      warn(s"$req failed on engine side", KyuubiSQLException(resp.getStatus))
    }
  }

  def closeOperation(operationHandle: TOperationHandle): Unit = {
    val req = new TCloseOperationReq(operationHandle)
    val resp = withLockAcquiredAsyncRequest(CloseOperation(req))
    if (resp.getStatus.getStatusCode == TStatusCode.SUCCESS_STATUS) {
      info(s"$req succeed on engine side")
    } else {
      warn(s"$req failed on engine side", KyuubiSQLException(resp.getStatus))
    }
  }

The client cannot know whether the close/cancel is success or failed.

Motivation

No response

Describe the solution

No response

Additional context

No response

Are you willing to submit PR?

  • Yes. I would be willing to submit a PR with guidance from the Kyuubi community to improve.
  • No. I cannot submit a PR at this time.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions