From 6feb1f32d7448088777feb64aaf1211dcc3fc9d8 Mon Sep 17 00:00:00 2001 From: henryzhx8 Date: Mon, 16 Dec 2024 03:31:06 +0000 Subject: [PATCH 1/3] block tmp dir for inotify --- core/CMakeLists.txt | 5 +++++ core/app_config/AppConfig.cpp | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 3dd6af2c93..89db3fb592 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -30,6 +30,7 @@ option(BUILD_LOGTAIL_SHARED_LIBRARY "Build Logtail shared library") option(ENABLE_ENTERPRISE "enable enterprise feature") cmake_dependent_option(ENABLE_COMPATIBLE_MODE "Build Logtail in compatible mode (for low version Linux)" OFF "LINUX" OFF) cmake_dependent_option(ENABLE_STATIC_LINK_CRT "Build Logtail by linking CRT statically" OFF "LINUX" OFF) +cmake_dependent_option(ENABLE_CORP_FEATURE "Enable corp feature" OFF "ENABLE_ENTERPRISE" OFF) option(WITHOUTGDB "Build Logtail without gdb") option(WITHSPL "Build Logtail and UT with SPL" ON) option(BUILD_LOGTAIL_UT "Build unit test for Logtail") @@ -46,6 +47,10 @@ if (ENABLE_ENTERPRISE) message(STATUS "Enable Enterprise Feature.") add_definitions(-D__ENTERPRISE__) include(${CMAKE_CURRENT_SOURCE_DIR}/enterprise_options.cmake) + if (ENABLE_CORP_FEATURE) + message(STATUS "Enable Corp Feature.") + add_definitions(-D__CORP__) + endif () else () include(${CMAKE_CURRENT_SOURCE_DIR}/options.cmake) endif () diff --git a/core/app_config/AppConfig.cpp b/core/app_config/AppConfig.cpp index 202d9f67f1..06ddaee64c 100644 --- a/core/app_config/AppConfig.cpp +++ b/core/app_config/AppConfig.cpp @@ -568,7 +568,11 @@ AppConfig::AppConfig() { mNoInotify = false; mSendDataPort = 80; mShennongSocket = true; - // mInotifyBlackList.insert("/tmp"); +#ifdef ___CORP__ + mInotifyBlackList.insert("/tmp"); // The constant creation and deletion of files in the /tmp directory by Pangu 2.0 + // may lead to increased resource consumption and system fluctuations for iLogtail + // which rely on inotify_add_watch and inotify_rm_watch for filesystem monitoring. +#endif mPurageContainerMode = false; mForceQuitReadTimeout = 7200; From baddf1fbb2431ee2ba69e72d7281b647890fea9f Mon Sep 17 00:00:00 2001 From: henryzhx8 Date: Mon, 16 Dec 2024 03:34:24 +0000 Subject: [PATCH 2/3] polish --- core/app_config/AppConfig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/app_config/AppConfig.cpp b/core/app_config/AppConfig.cpp index 06ddaee64c..3b787e33a3 100644 --- a/core/app_config/AppConfig.cpp +++ b/core/app_config/AppConfig.cpp @@ -568,7 +568,7 @@ AppConfig::AppConfig() { mNoInotify = false; mSendDataPort = 80; mShennongSocket = true; -#ifdef ___CORP__ +#ifdef __CORP__ mInotifyBlackList.insert("/tmp"); // The constant creation and deletion of files in the /tmp directory by Pangu 2.0 // may lead to increased resource consumption and system fluctuations for iLogtail // which rely on inotify_add_watch and inotify_rm_watch for filesystem monitoring. From 30dceb0303093dee86fed2ea932ab8d846b25b51 Mon Sep 17 00:00:00 2001 From: henryzhx8 Date: Mon, 16 Dec 2024 07:39:58 +0000 Subject: [PATCH 3/3] polish --- core/app_config/AppConfig.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/app_config/AppConfig.cpp b/core/app_config/AppConfig.cpp index 3b787e33a3..87a9a1ac4c 100644 --- a/core/app_config/AppConfig.cpp +++ b/core/app_config/AppConfig.cpp @@ -569,9 +569,10 @@ AppConfig::AppConfig() { mSendDataPort = 80; mShennongSocket = true; #ifdef __CORP__ - mInotifyBlackList.insert("/tmp"); // The constant creation and deletion of files in the /tmp directory by Pangu 2.0 - // may lead to increased resource consumption and system fluctuations for iLogtail - // which rely on inotify_add_watch and inotify_rm_watch for filesystem monitoring. + // for internal systems which read and write frequently on small files in /tmp,it may lead to increased resource + // consumption and system fluctuations which rely on inotify_add_watch and inotify_rm_watch for filesystem + // monitoring. + mInotifyBlackList.insert("/tmp"); #endif mPurageContainerMode = false;