Skip to content

Commit

Permalink
[pmon]chassisd crash fix (#396)
Browse files Browse the repository at this point in the history
This commit has fix for the chassisd crash reported by PR #16465
Root cause:
    - In the line card pmon, while pushing the hostname to
    CHASSIS_HOST_TABLE in chassis state db, the slot id is also pushed.
    The slot id (self.my_slot) is not a string. Since the FieldValue
    construction function expects string values, the wrapper raises
    value TypeError exception and hence chassisd exited.
Fix:
    - Fixed by hard converting self.my_slot to string while passing the
    value to the FieldValue data construction function.

Signed-off-by: vedganes <[email protected]>
Co-authored-by: gechiang <[email protected]>
Co-authored-by: abdosi <[email protected]>
  • Loading branch information
3 people authored and StormLiangMS committed Sep 21, 2023
1 parent 6fe5390 commit 54aa986
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sonic-chassisd/scripts/chassisd
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class ModuleUpdater(logger.Logger):
if not self._is_supervisor():
hostname_key = "{}{}".format(ModuleBase.MODULE_TYPE_LINE, int(self.my_slot) - 1)
hostname = try_get(device_info.get_hostname, default="None")
hostname_fvs = swsscommon.FieldValuePairs([(CHASSIS_MODULE_INFO_SLOT_FIELD, self.my_slot),
hostname_fvs = swsscommon.FieldValuePairs([(CHASSIS_MODULE_INFO_SLOT_FIELD, str(self.my_slot)),
(CHASSIS_MODULE_INFO_HOSTNAME_FIELD, hostname),
(CHASSIS_MODULE_INFO_NUM_ASICS_FIELD, str(len(module_info_dict[CHASSIS_MODULE_INFO_ASICS])))])
self.hostname_table.set(hostname_key, hostname_fvs)
Expand Down

0 comments on commit 54aa986

Please sign in to comment.