Skip to content

Commit

Permalink
[KYUUBI #2450] Update lastAccessTime in getStatus and add opHandle to…
Browse files Browse the repository at this point in the history
… opHandleSet before run

### _Why are the changes needed?_

close #2450

1. The client obtains the status of the Operation by calling getOperationStatus cyclically. We need to update the lastAccessTime in the getStatus method to prevent timeouts caused by long-running.
2. We need to add opHandle to opHandleSet before running to avoid losing Operation by calling close during Operation running.

### _How was this patch tested?_
- [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible

- [ ] Add screenshots for manual tests if appropriate

- [ ] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request

Closes #2452 from wForget/KYUUBI-2450.

Closes #2450

3500239 [wforget] add opHandle to opHandleSet before run
dc82f65 [wforget] unnecessary change
cca3377 [wforget] [KYUUBI-2450] Update lastAccessTime in getStatus and catch close launchEngineOp exception

Authored-by: wforget <643348094@qq.com>
Signed-off-by: Fei Wang <fwang12@ebay.com>
(cherry picked from commit 86f016d)
Signed-off-by: Fei Wang <fwang12@ebay.com>
  • Loading branch information
wForget authored and turboFei committed Apr 24, 2022
1 parent 099e9bb commit 8b14368
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ abstract class AbstractOperation(opType: OperationType, session: Session)
override def getHandle: OperationHandle = handle

override def getStatus: OperationStatus = {
lastAccessTime = System.currentTimeMillis()
OperationStatus(
state,
createTime,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ abstract class AbstractSession(
protected def runOperation(operation: Operation): OperationHandle = {
try {
val opHandle = operation.getHandle
operation.run()
opHandleSet.add(opHandle)
operation.run()
opHandle
} catch {
case e: KyuubiSQLException =>
Expand Down

0 comments on commit 8b14368

Please sign in to comment.