Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions be/src/common/metrics/system_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions be/src/common/metrics/system_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ class SystemMetrics {
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
Loading