From abb626883d03cb954caaf419178cfa5385a0d0eb Mon Sep 17 00:00:00 2001 From: zhuofeng <1107893276@qq.com> Date: Thu, 13 Mar 2025 01:54:16 +0000 Subject: [PATCH] fix ai_block_io bug and an issue with printing error Signed-off-by: zhuofeng <1107893276@qq.com> --- ...bug-and-an-issue-with-printing-error.patch | 45 +++++++++++++++++++ sysSentry.spec | 9 +++- 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 fix-ai_block_io-bug-and-an-issue-with-printing-error.patch diff --git a/fix-ai_block_io-bug-and-an-issue-with-printing-error.patch b/fix-ai_block_io-bug-and-an-issue-with-printing-error.patch new file mode 100644 index 0000000..638ec80 --- /dev/null +++ b/fix-ai_block_io-bug-and-an-issue-with-printing-error.patch @@ -0,0 +1,45 @@ +From bfe11a3c1d9ee11a34ee000509eb328b1e50f193 Mon Sep 17 00:00:00 2001 +From: zhuofeng <1107893276@qq.com> +Date: Wed, 12 Mar 2025 02:57:35 +0000 +Subject: [PATCH] fix ai_block_io bug and an issue with printing error + +Signed-off-by: zhuofeng <1107893276@qq.com> +--- + src/python/sentryPlugins/ai_block_io/detector.py | 3 ++- + src/python/syssentry/global_values.py | 2 +- + 2 files changed, 3 insertions(+), 2 deletions(-) + +diff --git a/src/python/sentryPlugins/ai_block_io/detector.py b/src/python/sentryPlugins/ai_block_io/detector.py +index 27fb7f7..2688cb1 100644 +--- a/src/python/sentryPlugins/ai_block_io/detector.py ++++ b/src/python/sentryPlugins/ai_block_io/detector.py +@@ -55,11 +55,12 @@ class Detector: + detection_result = self._slidingWindow.is_slow_io_event(metric_value) + # 检测到慢周期,由Detector负责打印info级别日志 + if detection_result[0][1]: ++ ai_threshold = "None" if detection_result[2] is None else round(detection_result[2], 3) + logging.info(f'[abnormal_period]: disk: {self._metric_name.disk_name}, ' + f'stage: {self._metric_name.stage_name}, ' + f'iotype: {self._metric_name.io_access_type_name}, ' + f'type: {self._metric_name.metric_name}, ' +- f'ai_threshold: {round(detection_result[2], 3)}, ' ++ f'ai_threshold: {ai_threshold}, ' + f'curr_val: {metric_value}') + else: + logging.debug(f'Detection result: {str(detection_result)}') +diff --git a/src/python/syssentry/global_values.py b/src/python/syssentry/global_values.py +index b123b2d..9c7800b 100644 +--- a/src/python/syssentry/global_values.py ++++ b/src/python/syssentry/global_values.py +@@ -114,7 +114,7 @@ class InspectTask: + try: + child = subprocess.Popen(cmd_list, stdout=logfile, stderr=subprocess.STDOUT, close_fds=True) + except OSError: +- logging.error("task %s start Popen error, invalid cmd") ++ logging.error("task %s start Popen error, invalid cmd", cmd_list) + self.result_info["result"] = ResultLevel.FAIL.name + self.result_info["error_msg"] = RESULT_LEVEL_ERR_MSG_DICT.get(ResultLevel.FAIL.name) + self.runtime_status = "FAILED" +-- +2.43.0 + diff --git a/sysSentry.spec b/sysSentry.spec index 6e867f6..5ca758d 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 74 +Release: 75 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -89,6 +89,7 @@ Patch76: uniform-avg_block_io-log-and-ai_block_io-log.patch Patch77: set-logrotate.patch Patch78: ebpf-adpat-to-the-kylin-platform.patch Patch79: fix-test_ai_block_io-fail.patch +Patch80: fix-ai_block_io-bug-and-an-issue-with-printing-error.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -344,6 +345,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/sentryCollector/__pycache__/collect_plugin* %changelog +* Thu Mar 13 2025 zhuofeng - 1.0.2-75 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:fix ai_block_io bug and an issue with printing error + * Wed Jan 22 2025 shixuantong - 1.0.2-74 - Type:bugfix - CVE:NA -- Gitee