From b5c93244fb4a2cc2eabf12f79ebf9881114b75b5 Mon Sep 17 00:00:00 2001 From: zhiqiang Date: Wed, 7 Aug 2024 19:27:51 +0800 Subject: [PATCH] [fix](cancel) Fix wrong status when query failed (#38982) Pipeline task A failed with `Status A`, pipeline task B should also fail with same `Status A` instead of just returning a CANCELLED. --- be/src/runtime/runtime_state.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/be/src/runtime/runtime_state.h b/be/src/runtime/runtime_state.h index d0c2f93103e8b5..cae6c4e6403ea9 100644 --- a/be/src/runtime/runtime_state.h +++ b/be/src/runtime/runtime_state.h @@ -729,9 +729,11 @@ class RuntimeState { std::string _s3_error_log_file_path; }; -#define RETURN_IF_CANCELLED(state) \ - do { \ - if (UNLIKELY((state)->is_cancelled())) return Status::Cancelled("Cancelled"); \ +#define RETURN_IF_CANCELLED(state) \ + do { \ + if (UNLIKELY((state)->is_cancelled())) { \ + return (state)->cancel_reason(); \ + } \ } while (false) } // namespace doris