From 6db763278e057d6caaa2ec788e86966a8c4d1ba6 Mon Sep 17 00:00:00 2001 From: Pete O_o Date: Fri, 6 Dec 2024 14:55:24 -0800 Subject: [PATCH] Add gating if system doesnt support hung_task_panic Summary: D66163794 introduced a fix for yv4 systems, but this change broke the conveyor for flashy as the conveyor tests on older platforms where this tunable option doesnt exist: https://www.internalfb.com/conveyor/openbmc/flashy/releases ``` 2024/12/06 05:49:41.832|4512|MainThread|D|paramiko_utils: 2024/12/06 05:49:41 {Err:Failed to write to hang_task_panic file '/proc/sys/kernel/hung_task_panic': open /proc/sys/kernel/hung_task_panic: no such file or directory github.com/facebook/openbmc/tools/flashy/checks_and_remediations/common.disableHangPanic /data/sandcastle/boxes/trunk-git-openbmc/tools/flashy/checks_and_remediations/common/15_disable_hang_panic.go:42 main.main /data/sandcastle/boxes/trunk-git-openbmc/tools/flashy/flashy.go:139 runtime.main /data/sandcastle/temp/skycastle/tmp.Fi68Iq6JqJ/go1.19.4/go/src/runtime/proc.go:250 runtime.goexit /data/sandcastle/temp/skycastle/tmp.Fi68Iq6JqJ/go1.19.4/go/src/runtime/asm_arm.s:831} ``` Test Plan: it builds and... eyes Reviewed By: amithash Differential Revision: D66903075 fbshipit-source-id: 3c1cb130cf2876a84bff30b96089bd64242b6e4f --- .../checks_and_remediations/common/15_disable_hang_panic.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/flashy/checks_and_remediations/common/15_disable_hang_panic.go b/tools/flashy/checks_and_remediations/common/15_disable_hang_panic.go index 93c2e3c74c28..ccf6a3d7a3c7 100644 --- a/tools/flashy/checks_and_remediations/common/15_disable_hang_panic.go +++ b/tools/flashy/checks_and_remediations/common/15_disable_hang_panic.go @@ -20,6 +20,8 @@ package common import ( + "log" + "os" "time" "github.com/facebook/openbmc/tools/flashy/lib/fileutils" @@ -35,6 +37,10 @@ const disableHangPanicFilePath = "/proc/sys/kernel/hung_task_panic" // disableHangPanic disables the "hung_task_panic". func disableHangPanic(stepParams step.StepParams) step.StepExitError { + if _, err := os.Stat(disableHangPanicFilePath); errors.Is(err, os.ErrNotExist) { + log.Printf("%v does not exist. not proceeding with disableHungPanic", disableHangPanicFilePath) + return nil + } err := fileutils.WriteFileWithTimeout( disableHangPanicFilePath, []byte("0"), 0644, 30*time.Second, )