Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix supervisor-proc-exit-listener false alert during warm reboot issue. #16742

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions files/scripts/supervisor-proc-exit-listener
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,21 @@ def get_group_and_process_list(process_file):
return group_list, process_list


def is_warm_reboot():
"""
Checks if a warm reboot is going on
"""
try:
state_db_connector = swsscommon.DBConnector("STATE_DB", 0)
tbl = swsscommon.Table(state_db_connector, 'WARM_RESTART_ENABLE_TABLE')
(status, value) = tbl.hget('system', 'enable')
if status and value == 'true':
return True
except RuntimeError as e:
syslog.syslog(syslog.LOG_ERR, "Check warm reboot status failed: {}".format(e))
return False


def generate_alerting_message(process_name, status, dead_minutes):
"""
@summary: If a critical process was not running, this function will determine it resides in host
Expand Down Expand Up @@ -212,6 +227,10 @@ def main(argv):
epoch_time = time.time()
elapsed_secs = epoch_time - process_heart_beat_info[process]["last_heart_beat"]
if elapsed_secs >= ALERTING_INTERVAL_SECS:
if is_warm_reboot() and process == "orchagent":
# Orchagent will set to frozen during warm reboot.
continue

elapsed_mins = elapsed_secs // 60
generate_alerting_message(process, "stuck", elapsed_mins)

Expand Down