Skip to content

Commit 0d79916

Browse files
authored
[chassis][psud] Move the PSU parent information generation to the loop run function from the initialization function (#576)
Description Move the PSU parent information generation to the loop run function from the initialization function Motivation and Context Fixes #575 How Has This Been Tested? Tested on Cisco chassis, the PHYSICAL_ENTITY_INFO|PSU * can be re-inserted after thermalctld restart. And monitored the stated db for memory for hours, works well:
1 parent 3fe8841 commit 0d79916

File tree

1 file changed

+7
-3
lines changed
  • sonic-psud/scripts

1 file changed

+7
-3
lines changed

sonic-psud/scripts/psud

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -405,9 +405,6 @@ class DaemonPsud(daemon_base.DaemonBase):
405405
fvs = swsscommon.FieldValuePairs([(CHASSIS_INFO_PSU_NUM_FIELD, str(self.num_psus))])
406406
self.chassis_tbl.set(CHASSIS_INFO_KEY, fvs)
407407

408-
# Update predefined position_in_parent and parent_name for PSU
409-
self._update_psu_entity_info()
410-
411408
def __del__(self):
412409
# Delete all the information from DB and then exit
413410
for psu_index in range(1, self.num_psus + 1):
@@ -438,6 +435,13 @@ class DaemonPsud(daemon_base.DaemonBase):
438435
# We received a fatal signal
439436
return False
440437

438+
# Update predefined position_in_parent and parent_name for PSU
439+
# it was in the __init__ function which means will be run only once
440+
# But there's chance that the keys(PHYSICAL_ENTITY_INFO|*) got removed by other processes,
441+
# like the exit function during the restart of thermalctld,
442+
# hence move it to the iteration run, so the key will be filled again after removed.
443+
self._update_psu_entity_info()
444+
441445
self.update_psu_data()
442446
self._update_led_color()
443447

0 commit comments

Comments
 (0)