Skip to content

Commit

Permalink
[thermalctld] No need exit thermalcltd when loading invalid policy fi…
Browse files Browse the repository at this point in the history
…le (sonic-net#172)

Currently, when thermalctld loading an invalid policy file, it catches the exception and call sys.exit. However, there is a sub process created and sys.exit cause the daemon hang forever. Actually, it is not necessary to exit thermalctld here because:

1. Other than running thermal policy, there is a sub process which monitoring thermal status. So even if there is an invalid policy file, thermal monitoring can still work.
2. Even if we exit here, supervisord will restart thermalctld and it fall into the same exception again and again.
  • Loading branch information
Junchao-Mellanox authored Apr 9, 2021
1 parent 5b6d9c0 commit eff5c1c
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions sonic-thermalctld/scripts/thermalctld
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ PHYSICAL_ENTITY_INFO_TABLE = 'PHYSICAL_ENTITY_INFO'
INVALID_SLOT = -1

ERR_UNKNOWN = 1
ERR_INIT_FAILED = 2

# Thermal control daemon is designed to never exit, it must always
# return non-zero exit code when exiting and so that supervisord will
Expand Down Expand Up @@ -761,7 +760,6 @@ class ThermalControlDaemon(daemon_base.DaemonBase):
self.log_warning('Thermal manager is not supported on this platform')
except Exception as e:
self.log_error('Caught exception while initializing thermal manager - {}'.format(repr(e)))
sys.exit(ERR_INIT_FAILED)

def deinit(self):
"""
Expand Down

0 comments on commit eff5c1c

Please sign in to comment.