From eff5c1c83035a6f2bf07ba1a22c91db67e325a14 Mon Sep 17 00:00:00 2001 From: Junchao-Mellanox <57339448+Junchao-Mellanox@users.noreply.github.com> Date: Fri, 9 Apr 2021 08:56:07 +0800 Subject: [PATCH] [thermalctld] No need exit thermalcltd when loading invalid policy file (#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. --- sonic-thermalctld/scripts/thermalctld | 2 -- 1 file changed, 2 deletions(-) diff --git a/sonic-thermalctld/scripts/thermalctld b/sonic-thermalctld/scripts/thermalctld index 7dbc3d99fc98..5c14499841f2 100644 --- a/sonic-thermalctld/scripts/thermalctld +++ b/sonic-thermalctld/scripts/thermalctld @@ -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 @@ -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): """