Skip to content

Commit

Permalink
thermalctld: Ignore exception when deleting chassisdb entry fails
Browse files Browse the repository at this point in the history
After sonic-mgmt tests, it does a config consistency check and if the
config consistency check fails, it runs recover_chassis(). That
function simultaneously runs config_reload on the supervisor and all
linecards (in parallel). This means that the supervisor networking can
be in the process of restarting when thermalctld exits and goes
through the cleanup process of deleting entries from chassisdb.
  • Loading branch information
patrickmacarthur committed Jan 29, 2025
1 parent c61323f commit d2e7e87
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions sonic-thermalctld/scripts/thermalctld
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,14 @@ class TemperatureUpdater(logger.Logger):
table_keys = self.table.getKeys()
for tk in table_keys:
self.table._del(tk)
if self.is_chassis_upd_required and self.chassis_table is not None:
self.chassis_table._del(tk)
try:
if self.is_chassis_upd_required and self.chassis_table is not None:
self.chassis_table._del(tk)
except Exception as e:
# On a chassis system it is possible we may lose connection
# to the supervisor and chassisdb. If this happens then we
# should simply remove our handle to chassisdb.
self.chassis_table = None
if self.phy_entity_table:
phy_entity_keys = self.phy_entity_table.getKeys()
for pek in phy_entity_keys:
Expand Down

0 comments on commit d2e7e87

Please sign in to comment.