Skip to content

Commit 98ab5a7

Browse files
authored
Update heartbeat and alert interval logic
1 parent 4112b18 commit 98ab5a7

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

files/scripts/supervisor-proc-exit-listener

+3-2
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,9 @@ def main(argv):
233233
for process in process_heart_beat_info.keys():
234234
epoch_time = time.time()
235235
elapsed_secs = epoch_time - process_heart_beat_info[process]["last_heart_beat"]
236-
if elapsed_secs >= get_heartbeat_alert_interval(process):
237-
elapsed_mins = elapsed_secs // 60
236+
threshold = get_heartbeat_alert_interval(process)
237+
if threshold > 0 and elapsed_secs >= threshold:
238+
elapsed_mins = elapsed_secs
238239
generate_alerting_message(process, "stuck", elapsed_mins, syslog.LOG_WARNING)
239240

240241
if __name__ == "__main__":

src/sonic-yang-models/yang-models/sonic-heartbeat.yang

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module sonic-heartbeat {
3939
leaf heartbeat_interval {
4040
description "Heartbeat interval in millisecond";
4141
type uint32;
42-
default "100000";
42+
default "10000";
4343
}
4444

4545
leaf alert_interval {

0 commit comments

Comments
 (0)