@@ -209,16 +209,24 @@ void SwitchOrch::initAsicSdkHealthEventNotification()
209
209
210
210
set_switch_capability (fvVector);
211
211
212
- // Load the Lua script to eliminate oldest entries
213
- string eliminateEventsLuaScript = swss::loadLuaScript (" eliminate_events.lua" );
214
- m_eliminateEventsSha = swss::loadRedisScript (m_stateDb.get (), eliminateEventsLuaScript);
215
-
216
- // Init timer
217
- auto interv = timespec { .tv_sec = ASIC_SDK_HEALTH_EVENT_ELIMINATE_INTERVAL, .tv_nsec = 0 };
218
- m_eliminateEventsTimer = new SelectableTimer (interv);
219
- auto executor = new ExecutableTimer (m_eliminateEventsTimer, this , " ASIC_SDK_HEALTH_EVENT_ELIMINATE_TIMER" );
220
- Orch::addExecutor (executor);
221
- m_eliminateEventsTimer->start ();
212
+ try
213
+ {
214
+ // Load the Lua script to eliminate oldest entries
215
+ string eliminateEventsLuaScript = swss::loadLuaScript (" eliminate_events.lua" );
216
+ m_eliminateEventsSha = swss::loadRedisScript (m_stateDb.get (), eliminateEventsLuaScript);
217
+
218
+ // Init timer
219
+ auto interv = timespec { .tv_sec = ASIC_SDK_HEALTH_EVENT_ELIMINATE_INTERVAL, .tv_nsec = 0 };
220
+ m_eliminateEventsTimer = new SelectableTimer (interv);
221
+ auto executor = new ExecutableTimer (m_eliminateEventsTimer, this , " ASIC_SDK_HEALTH_EVENT_ELIMINATE_TIMER" );
222
+ Orch::addExecutor (executor);
223
+ m_eliminateEventsTimer->start ();
224
+ }
225
+ catch (...)
226
+ {
227
+ // This can happen only on mock test. If it happens on a real switch, we should log an error message
228
+ SWSS_LOG_ERROR (" Unable to load the Lua script to eliminate events\n " );
229
+ }
222
230
}
223
231
224
232
void SwitchOrch::initAclGroupsBindToSwitch ()
0 commit comments