From 13ffb3d736f594073e52aa71e527c8015382d842 Mon Sep 17 00:00:00 2001 From: Jerry Hu Date: Wed, 18 Sep 2024 10:53:41 +0800 Subject: [PATCH] [fix](compaction) catch exception in compcation --- be/src/olap/tablet.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/be/src/olap/tablet.cpp b/be/src/olap/tablet.cpp index 66278afdb666ee..e3ac43c734a9f3 100644 --- a/be/src/olap/tablet.cpp +++ b/be/src/olap/tablet.cpp @@ -57,6 +57,7 @@ #include "agent/utils.h" #include "common/config.h" #include "common/consts.h" +#include "common/exception.h" #include "common/logging.h" #include "common/signal_handler.h" #include "common/status.h" @@ -1788,8 +1789,7 @@ void Tablet::execute_compaction(CompactionMixin& compaction) { MonotonicStopWatch watch; watch.start(); - Status res = compaction.execute_compact(); - + Status res = [&]() { RETURN_IF_CATCH_EXCEPTION({ return compaction.execute_compact(); }); }(); if (!res.ok()) [[unlikely]] { set_last_failure_time(this, compaction, UnixMillis()); LOG(WARNING) << "failed to do " << compaction.compaction_name()