From d84ff785775e27b2b0ed66abc34ca83db434226f Mon Sep 17 00:00:00 2001 From: jinsaihang Date: Fri, 1 Nov 2024 11:01:46 +0800 Subject: [PATCH] excessive CPU usage Signed-off-by: jinsaihang --- fix-excessive-CPU-usage.patch | 41 +++++++++++++++++++++++++++++++++++ sysSentry.spec | 9 +++++++- 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 fix-excessive-CPU-usage.patch diff --git a/fix-excessive-CPU-usage.patch b/fix-excessive-CPU-usage.patch new file mode 100644 index 0000000..b72ed52 --- /dev/null +++ b/fix-excessive-CPU-usage.patch @@ -0,0 +1,41 @@ +From 815537382fc0d5164fe57b0d984ca4a1ed8254ea Mon Sep 17 00:00:00 2001 +From: jinsaihang +Date: Thu, 31 Oct 2024 16:00:50 +0800 +Subject: [PATCH] excessive CPU usage + +Signed-off-by: jinsaihang +--- + sysSentry-1.0.2/src/python/xalarm/xalarm_transfer.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/src/python/xalarm/xalarm_transfer.py b/src/python/xalarm/xalarm_transfer.py +index b072007..4bebe5d 100644 +--- a/src/python/xalarm/xalarm_transfer.py ++++ b/src/python/xalarm/xalarm_transfer.py +@@ -62,7 +62,6 @@ def cleanup_closed_connections(server_sock, epoll, fd_to_socket): + to_remove.append(fileno) + + for fileno in to_remove: +- epoll.unregister(fileno) + fd_to_socket[fileno].close() + del fd_to_socket[fileno] + logging.info(f"cleaned up connection {fileno} for client lost connection.") +@@ -97,7 +96,6 @@ def wait_for_connection(server_sock, epoll, fd_to_socket, thread_should_stop): + logging.info(f"connection reach max num of {MAX_CONNECTION_NUM}, closed current connection!") + connection.close() + continue +- epoll.register(connection.fileno(), select.EPOLLOUT) + fd_to_socket[connection.fileno()] = connection + except socket.error as e: + logging.debug(f"socket error, reason is {e}") +@@ -122,7 +120,6 @@ def transmit_alarm(server_sock, epoll, fd_to_socket, bin_data): + except (BrokenPipeError, ConnectionResetError): + to_remove.append(fileno) + for fileno in to_remove: +- epoll.unregister(fileno) + fd_to_socket[fileno].close() + del fd_to_socket[fileno] + logging.info(f"cleaned up connection {fileno} for client lost connection.") +-- +2.27.0 + diff --git a/sysSentry.spec b/sysSentry.spec index 2a5f6a4..194bd8d 100644 --- a/sysSentry.spec +++ b/sysSentry.spec @@ -4,7 +4,7 @@ Summary: System Inspection Framework Name: sysSentry Version: 1.0.2 -Release: 55 +Release: 56 License: Mulan PSL v2 Group: System Environment/Daemons Source0: https://gitee.com/openeuler/sysSentry/releases/download/v%{version}/%{name}-%{version}.tar.gz @@ -75,6 +75,7 @@ Patch62: add-hbm-online-repair.patch Patch63: fix-hbm-online-repair-notice-and-efi-create.patch Patch64: get_alarm-d-abnomal-display.patch Patch65: modify-logrotate-rule.patch +Patch66: fix-excessive-CPU-usage.patch BuildRequires: cmake gcc-c++ BuildRequires: python3 python3-setuptools @@ -368,6 +369,12 @@ rm -rf %{buildroot} %attr(0550,root,root) %{python3_sitelib}/syssentry/bmc_alarm.py %changelog +* Fri Nov 1 2024 jinsaihang - 1.0.2-56 +- Type:bugfix +- CVE:NA +- SUG:NA +- DES:excessive CPU usage + * Thu Oct 31 2024 zhangnan - 1.0.2-55 - Type:bugfix - CVE:NA -- Gitee