Skip to content

Commit

Permalink
[KYUUBI apache#6843] FIX 'query-timeout-thread' thread leak
Browse files Browse the repository at this point in the history
  • Loading branch information
liupeiyue committed Dec 9, 2024
1 parent dc3ac89 commit 78a9fde
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ class PlanOnlyStatement(
statement)
resultSet =
ResultSetUtil.fromResultFetcher(resultFetcher, resultMaxRows, resultFetchTimeout);
case _ => explainOperation(statement)
shutdownTimeoutMonitor
case _ =>
explainOperation(statement)
shutdownTimeoutMonitor
}
} catch {
onError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ class ExecutePython(
val ke =
KyuubiSQLException("Error submitting python in background", rejected)
setOperationException(ke)
shutdownTimeoutMonitor
throw ke
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ class ExecuteScala(
val ke =
KyuubiSQLException("Error submitting scala in background", rejected)
setOperationException(ke)
shutdownTimeoutMonitor
throw ke
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class ExecuteStatement(
val ke =
KyuubiSQLException("Error submitting query in background, query rejected", rejected)
setOperationException(ke)
shutdownTimeoutMonitor
throw ke
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class ExecuteStatement(
val ke =
KyuubiSQLException("Error submitting query in background, query rejected", rejected)
setOperationException(ke)
shutdownTimeoutMonitor
throw ke
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,10 @@ class ExecuteStatement(
try {
val opHandle = sessionManager.submitBackgroundOperation(asyncOperation)
setBackgroundHandle(opHandle)
} catch onError("submitting query in background, query rejected")
} catch {
shutdownTimeoutMonitor
onError("submitting query in background, query rejected")
}

if (!shouldRunAsync) getBackgroundHandle.get()
}
Expand Down

0 comments on commit 78a9fde

Please sign in to comment.