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: Use retryInterval when a monitor is DOWN #4476

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion server/model/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,9 @@ class Monitor extends BeanModel {
if (result.toString() === this.expectedValue) {
bean.msg += ", expected value is found";
bean.status = UP;
console.log("neelbhanushali: json-query successful");
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
} else {
console.log("neelbhanushali: json-query unsuccessful");
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
throw new Error(bean.msg + ", but value is not equal to expected value, value was: [" + result + "]");
}
}
Expand Down Expand Up @@ -898,7 +900,7 @@ class Monitor extends BeanModel {
retries = 0;

} catch (error) {

console.log("neelbhanushali: came in catch");
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
if (error?.name === "CanceledError") {
bean.msg = `timeout by AbortSignal (${this.timeout}s)`;
} else {
Expand All @@ -913,6 +915,7 @@ class Monitor extends BeanModel {
} else if ((this.maxretries > 0) && (retries < this.maxretries)) {
retries++;
bean.status = PENDING;
console.log("neelbhanushali: checking retries", retries, this.maxretries);
CommanderStorm marked this conversation as resolved.
Show resolved Hide resolved
} else {
// Continue counting retries during DOWN
retries++;
Expand Down Expand Up @@ -971,6 +974,7 @@ class Monitor extends BeanModel {
} else if (bean.status === MAINTENANCE) {
log.warn("monitor", `Monitor #${this.id} '${this.name}': Under Maintenance | Type: ${this.type}`);
} else {
beatInterval = this.retryInterval;
log.warn("monitor", `Monitor #${this.id} '${this.name}': Failing: ${bean.msg} | Interval: ${beatInterval} seconds | Type: ${this.type} | Down Count: ${bean.downCount} | Resend Interval: ${this.resendInterval}`);
}

Expand Down