Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion be/src/pipeline/exec/scan_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1461,7 +1461,7 @@ Status ScanOperatorX<LocalStateType>::get_block(RuntimeState* state, vectorized:
if (local_state._scanner_ctx) {
local_state._scanner_ctx->stop_scanners(state);
}
return Status::Cancelled("Query cancelled in ScanOperator");
return state->cancel_reason();
}

if (local_state._eos) {
Expand Down
10 changes: 9 additions & 1 deletion be/src/runtime/runtime_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,15 @@ bool RuntimeState::is_cancelled() const {
}

Status RuntimeState::cancel_reason() const {
return _exec_status.status();
if (!_exec_status.ok()) {
return _exec_status.status();
}

if (_query_ctx) {
return _query_ctx->exec_status();
}

return Status::Cancelled("Query cancelled");
}

const int64_t MAX_ERROR_NUM = 50;
Expand Down
2 changes: 1 addition & 1 deletion be/src/vec/exec/scan/scanner_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Status ScannerContext::get_block_from_queue(RuntimeState* state, vectorized::Blo
bool* eos, int id) {
if (state->is_cancelled()) {
_set_scanner_done();
return Status::Cancelled("Query cancelled in ScannerContext");
return state->cancel_reason();
}
std::unique_lock l(_transfer_lock);

Expand Down