Skip to content

Commit eff5c1c

Browse files
[thermalctld] No need exit thermalcltd when loading invalid policy file (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.
1 parent 5b6d9c0 commit eff5c1c

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

sonic-thermalctld/scripts/thermalctld

-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ PHYSICAL_ENTITY_INFO_TABLE = 'PHYSICAL_ENTITY_INFO'
2929
INVALID_SLOT = -1
3030

3131
ERR_UNKNOWN = 1
32-
ERR_INIT_FAILED = 2
3332

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

766764
def deinit(self):
767765
"""

0 commit comments

Comments
 (0)