From 91cb60ce7c0780b990aa6d3655901fa310c6d124 Mon Sep 17 00:00:00 2001 From: bobhan1 Date: Tue, 11 Feb 2025 12:18:36 +0800 Subject: [PATCH] [Fix](memory) Add try catch block for `Segment::load_pk_index_and_bf` (#47715) --- be/src/olap/rowset/segment_v2/segment.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/be/src/olap/rowset/segment_v2/segment.cpp b/be/src/olap/rowset/segment_v2/segment.cpp index 9126a081d54828..1f98eafd6fcf4c 100644 --- a/be/src/olap/rowset/segment_v2/segment.cpp +++ b/be/src/olap/rowset/segment_v2/segment.cpp @@ -25,6 +25,7 @@ #include #include +#include "common/exception.h" #include "common/logging.h" #include "common/status.h" #include "io/fs/file_reader.h" @@ -327,8 +328,13 @@ Status Segment::_load_pk_bloom_filter() { } Status Segment::load_pk_index_and_bf() { - RETURN_IF_ERROR(load_index()); - RETURN_IF_ERROR(_load_pk_bloom_filter()); + // `DorisCallOnce` may catch exception in calling stack A and re-throw it in + // a different calling stack B which doesn't have catch block. So we add catch block here + // to prevent coreudmp + RETURN_IF_CATCH_EXCEPTION({ + RETURN_IF_ERROR(load_index()); + RETURN_IF_ERROR(_load_pk_bloom_filter()); + }); return Status::OK(); }