From eb0af1c72d2a43b05fb77dce5854ad757254c662 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Sat, 30 Mar 2024 16:10:09 -0400 Subject: [PATCH] [supervisor][sfm]Fix the issue of swss.sh shows backtrace when shutdown a SFM. (#18393) On a Supervisor card of a VOQ chassis, when remove or shutdown a Fabric card, swss.sh shows Stacktrace for all related empty SFM slots in the syslog file. This PR fixes #18384 How I did it In the asic_status.py, all empty SFM slots related swss.sh is in the waiting state to wait for the presence event of SFM -- SET operation. The subscriber event handler also includes the "DEL" operation when a SFM is shutdown/removal. When a SFM is shutdown, all empty slot's swss.sh also get the "DEL" event although it is not for them. In the "DEL" operation, the current implementation doesn't check if this "DEL" operation for them, and then they exit the wait state and proceed to docker-wait-any with wrong operation in the wrong slot. docker-wait0any raise the backtarce. How to verify it In a chassis which has some empty SMF slot, remove or shutdown a SFM. There should not be related stacktrace shown in syslog Signed-off-by: mlok --- files/scripts/asic_status.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/scripts/asic_status.py b/files/scripts/asic_status.py index 81a7aabc9758..a518caac8b43 100755 --- a/files/scripts/asic_status.py +++ b/files/scripts/asic_status.py @@ -69,8 +69,9 @@ def main(): logger.log_info('Detected asic{} is online'.format(global_asic_id)) sys.exit(0) elif asic_op == 'DEL': - logger.log_info('Detected asic{} is offline'.format(global_asic_id)) - sys.exit(1) + if (global_asic_id == args_asic_id): + logger.log_info('Detected asic{} is offline'.format(global_asic_id)) + sys.exit(1) else: continue