This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 4eaa942f8ff [fix](Reliability)Fix Doris query service fails after the
file handles on the BE node are used up (#62393)
4eaa942f8ff is described below
commit 4eaa942f8ffc589d98bdbdb45dfce03e08391fc5
Author: Guangming Lu <[email protected]>
AuthorDate: Thu Apr 16 10:18:31 2026 +0800
[fix](Reliability)Fix Doris query service fails after the file handles on
the BE node are used up (#62393)
---
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 560cbf2d6ee..4733df51442 100644
--- a/be/src/common/config.cpp
+++ b/be/src/common/config.cpp
@@ -1773,6 +1773,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 95bf94667d7..500f523f49c 100644
--- a/be/src/common/config.h
+++ b/be/src/common/config.h
@@ -1817,6 +1817,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 7670bc54298..3dfd6186443 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"
@@ -431,6 +432,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]