Skip to content

Commit

Permalink
chore: move http detach to kill (#13606)
Browse files Browse the repository at this point in the history
  • Loading branch information
BohuTANG authored Nov 6, 2023
1 parent a7f8003 commit db6728a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ async fn query_cancel_handler(
let http_query_manager = HttpQueryManager::instance();
match http_query_manager.get_query(&query_id).await {
Some(query) => {
query.detach().await;
query.kill().await;
http_query_manager.remove_query(&query_id).await;
StatusCode::OK
Expand Down
7 changes: 6 additions & 1 deletion src/query/service/src/servers/http/v1/query/http_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ impl HttpQuery {

#[async_backtrace::framed]
pub async fn kill(&self) {
// the query will be removed from the query manager before the session is dropped.
self.detach().await;

Executor::stop(
&self.state,
Err(ErrorCode::AbortedQuery("killed by http")),
Expand All @@ -472,7 +475,9 @@ impl HttpQuery {
}

#[async_backtrace::framed]
pub async fn detach(&self) {
async fn detach(&self) {
info!("{}: http query detached", &self.id);

let data = self.page_manager.lock().await;
data.detach().await
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ impl HttpQueryManager {
warn!("{msg}, but fail to remove");
} else {
warn!("{msg}");
query.detach().await;
query.kill().await;
};
break;
Expand Down

0 comments on commit db6728a

Please sign in to comment.