This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-4.1 by this push:
new bb97072d0c8 branch-4.1: [fix](Reliability)Fix Doris query service
fails after the file handles on the BE node are used up #62393 (#62540)
bb97072d0c8 is described below
commit bb97072d0c81b29402918c2c6a00a5eaaf9a8e6a
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Apr 16 23:43:19 2026 +0800
branch-4.1: [fix](Reliability)Fix Doris query service fails after the file
handles on the BE node are used up #62393 (#62540)
Cherry-picked from #62393
Co-authored-by: Guangming Lu <[email protected]>
---
be/src/common/config.cpp | 1 +
be/src/common/config.h | 1 +
be/src/common/metrics/system_metrics.cpp | 13 +++++++++++++
be/src/common/metrics/system_metrics.h | 1 +
4 files changed, 16 insertions(+)
diff --git a/be/src/common/config.cpp b/be/src/common/config.cpp
index ccdb9ffe22c..45a4c8dc631 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1739,6 +1739,7 @@ DEFINE_Validator(concurrency_stats_dump_interval_ms,
DEFINE_mBool(cloud_mow_sync_rowsets_when_load_txn_begin, "true");
DEFINE_mBool(enable_cloud_make_rs_visible_on_be, "false");
+DEFINE_mInt32(file_handles_deplenish_frequency_times, "3");
// clang-format off
#ifdef BE_TEST
diff --git a/be/src/common/config.h b/be/src/common/config.h
index 39e176e4672..75d3b8e717b 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1787,6 +1787,7 @@ DECLARE_mInt32(concurrency_stats_dump_interval_ms);
DECLARE_mBool(cloud_mow_sync_rowsets_when_load_txn_begin);
DECLARE_mBool(enable_cloud_make_rs_visible_on_be);
+DECLARE_mInt32(file_handles_deplenish_frequency_times);
#ifdef BE_TEST
// test s3
diff --git a/be/src/common/metrics/system_metrics.cpp
b/be/src/common/metrics/system_metrics.cpp
index 5f28be0d554..f111c04b491 100644
--- a/be/src/common/metrics/system_metrics.cpp
+++ b/be/src/common/metrics/system_metrics.cpp
@@ -26,6 +26,7 @@
#include <utility>
#include "common/cast_set.h"
+#include "common/config.h"
#include "runtime/memory/jemalloc_control.h"
#include "util/cgroup_util.h"
#include "util/perf_counters.h"
@@ -432,6 +433,18 @@ void SystemMetrics::_update_cpu_metrics() {
char buf[64];
LOG(WARNING) << "open /proc/stat failed, errno=" << errno
<< ", message=" << strerror_r(errno, buf, 64);
+ if (errno == 24) {
+ _file_handle_deplenish_counter++;
+ } else {
+ _file_handle_deplenish_counter = 0;
+ }
+ // Threshold of the number of consecutive failures
+ if (_file_handle_deplenish_counter >=
config::file_handles_deplenish_frequency_times) {
+ LOG(FATAL) << "The system file handles are insufficient, causing
service exceptions"
+ << ", BE will exit. please check the configs 'soft
nofile'"
+ << " and 'hard nofile' of /etc/security/limits.conf ";
+ exit(-1);
+ }
return;
}
diff --git a/be/src/common/metrics/system_metrics.h
b/be/src/common/metrics/system_metrics.h
index c2c7c8fa333..52ca7299f70 100644
--- a/be/src/common/metrics/system_metrics.h
+++ b/be/src/common/metrics/system_metrics.h
@@ -121,6 +121,7 @@ private:
IntGauge* max_disk_io_util_percent = nullptr;
IntGauge* max_network_send_bytes_rate = nullptr;
IntGauge* max_network_receive_bytes_rate = nullptr;
+ int _file_handle_deplenish_counter = 0;
};
} // namespace doris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]