This is an automated email from the ASF dual-hosted git repository. yiguolei pushed a commit to branch branch-2.1 in repository https://gitbox.apache.org/repos/asf/doris.git
commit 1322c813d3941e5684ccd0966b7ea815b7417661 Author: wangbo <[email protected]> AuthorDate: Wed Jan 24 20:36:53 2024 +0800 [Fix](executor)Fix return stack to fe #30316 --- be/src/common/exception.h | 2 +- be/src/common/status.h | 9 +++++++++ be/src/pipeline/task_scheduler.cpp | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/be/src/common/exception.h b/be/src/common/exception.h index 3a2be010627..39d675a7cc4 100644 --- a/be/src/common/exception.h +++ b/be/src/common/exception.h @@ -54,7 +54,7 @@ public: const char* what() const noexcept override { return to_string().c_str(); } - Status to_status() const { return Status::Error<false>(code(), to_string()); } + Status to_status() const { return Status(code(), _err_msg->_msg, _err_msg->_stack); } private: int _code; diff --git a/be/src/common/status.h b/be/src/common/status.h index c22f4c568ff..03da5fb48a4 100644 --- a/be/src/common/status.h +++ b/be/src/common/status.h @@ -315,6 +315,15 @@ class [[nodiscard]] Status { public: Status() : _code(ErrorCode::OK), _err_msg(nullptr) {} + // used to convert Exception to Status + Status(int code, std::string msg, std::string stack) : _code(code) { + _err_msg = std::make_unique<ErrMsg>(); + _err_msg->_msg = msg; +#ifdef ENABLE_STACKTRACE + _err_msg->_stack = stack; +#endif + } + // copy c'tor makes copy of error detail so Status can be returned by value Status(const Status& rhs) { *this = rhs; } diff --git a/be/src/pipeline/task_scheduler.cpp b/be/src/pipeline/task_scheduler.cpp index 1f8a714a623..77cdddfb4a7 100644 --- a/be/src/pipeline/task_scheduler.cpp +++ b/be/src/pipeline/task_scheduler.cpp @@ -301,7 +301,7 @@ void TaskScheduler::_do_work(size_t index) { "Pipeline task failed. query_id: {} reason: {}", PrintInstanceStandardInfo(task->query_context()->query_id(), task->fragment_context()->get_fragment_instance_id()), - status.msg()); + status.to_string()); // Print detail informations below when you debugging here. // // LOG(WARNING)<< "task:\n"<<task->debug_string(); --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
