-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[Heartbeat]: fix status field when monitors are down #36623
[Heartbeat]: fix status field when monitors are down #36623
Conversation
Pinging @elastic/uptime (Team:Uptime) |
This pull request does not have a backport label.
To fixup this pull request, you need to add the backport labels for the needed
|
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures> Show only the first 10 test failures
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only tested functionality and it seems to be working now !!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs tests, and I'm not sure this code works
newJs := *NewJobSummary(js.Attempt+1, js.MaxAttempts, js.RetryGroup) | ||
newJs.Up = js.Up | ||
newJs.Down = js.Down | ||
newJs.Status = js.Status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why a new job would inherit the status of the old job, same for the up
and down
fields, those should be set during the execution of the new job. If this fixes the bug I don't understand why. Also, we need tests.
Does this code work if the first attempt is down, but the second is up? As I read it the answer would be no, but I may misunderstand
I think we should close this in favor of #36704 |
) [Heartbeat] Fix missing monitor.status value in initial attempt where max_attempts > 2. Introduced in elastic#36623 adding tests to the scenario runner as well. Original cause was this PR elastic#36519 that did not produce the correct monitor.status: down when the monitor is retried with the second attempt.
monitor.status: down
when the monitor is retried with the second attempt.monitor.status: ""
field which is incorrect. The PR fixes the issue, by correctly setting the Up/Down and also maintain the previous status when retry is attempted.Test monitor