From 5aae3b75d924506c67c4a0e22448d121e02e1e9a Mon Sep 17 00:00:00 2001 From: Lindley Werner Soares Vieira Date: Mon, 18 Sep 2023 14:42:32 -0300 Subject: [PATCH] Fix system raising alarm due to outdated file in memory In DX system, during a forced reboot in the active controller, when the host recovers, a 900.002 alarm is raised. This happens because handle-install removes a flag file, but the next service starts up in less than 200ms and the python garbage collector was not able to remove the file from memory. Solution: Force a garbage collector call after removing the file. Test Plan: PASS: In DX, apply a patch, force reboot the active controller. After the host was recovered, the 900.002 alarm should not be raised. Closes-bug: 2037724 Closes-bug: 2037725 Change-Id: Idb92d2295c4330704d1ad8b1110477d64ee26583 Signed-off-by: Lindley Werner --- sw-patch/cgcs-patch/cgcs_patch/patch_agent.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sw-patch/cgcs-patch/cgcs_patch/patch_agent.py b/sw-patch/cgcs-patch/cgcs_patch/patch_agent.py index 38f73bce..49ab94a4 100644 --- a/sw-patch/cgcs-patch/cgcs_patch/patch_agent.py +++ b/sw-patch/cgcs-patch/cgcs_patch/patch_agent.py @@ -1,9 +1,10 @@ """ -Copyright (c) 2014-2022 Wind River Systems, Inc. +Copyright (c) 2014-2023 Wind River Systems, Inc. SPDX-License-Identifier: Apache-2.0 """ +import gc import json import os import random @@ -546,6 +547,9 @@ class PatchAgent(PatchService): hello_ack = PatchMessageHelloAgentAck() hello_ack.send(self.sock_out) + # Call python garbage collector to ensure the removal of cleared flags + gc.collect() + # Indicate if the method was successful # success means no change needed, or a change worked. return success