From bb8a15ca56c448f4b6b72ad9af44f4b630d55cde Mon Sep 17 00:00:00 2001 From: ssongliu <73214554+ssongliu@users.noreply.github.com> Date: Fri, 4 Jul 2025 10:19:39 +0800 Subject: [PATCH] fix: Fix system load spike during disk mount failures (#9399) Refs #8827 --- agent/app/service/dashboard.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/app/service/dashboard.go b/agent/app/service/dashboard.go index 268587e2f..f5f28491d 100644 --- a/agent/app/service/dashboard.go +++ b/agent/app/service/dashboard.go @@ -390,10 +390,10 @@ type diskInfo struct { func loadDiskInfo() []dto.DiskInfo { var datas []dto.DiskInfo cmdMgr := cmd.NewCommandMgr(cmd.WithTimeout(2 * time.Second)) - stdout, err := cmdMgr.RunWithStdoutBashC("df -hT -P|grep '/'|grep -v tmpfs|grep -v 'snap/core'|grep -v udev") + stdout, err := cmdMgr.RunWithStdoutBashC("timeout 2 df -hT -P | awk 'NR>1 && !/tmpfs|snap\\/core|udev/ {print}'") if err != nil { cmdMgr2 := cmd.NewCommandMgr(cmd.WithTimeout(1 * time.Second)) - stdout, err = cmdMgr2.RunWithStdoutBashC("df -lhT -P|grep '/'|grep -v tmpfs|grep -v 'snap/core'|grep -v udev") + stdout, err = cmdMgr2.RunWithStdoutBashC("timeout 1 df -lhT -P | awk 'NR>1 && !/tmpfs|snap\\/core|udev/ {print}'") if err != nil { return datas }