-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Adjust auto-disable connection logic for spam #12288
Conversation
@@ -73,13 +75,16 @@ public AutoDisableConnectionOutput autoDisableFailingConnection(final AutoDisabl | |||
} | |||
} | |||
|
|||
final boolean warningPreviouslySentForMaxDays = | |||
numFailures > 1 && warningPreviouslySentForMaxDays(successTimestamp, maxDaysOfOnlyFailedJobsBeforeWarning, firstJob, jobs); |
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.
Why do we check numFailures > 1
here?
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.
We only send warnings/check for auto-disabling after a failure.
So if this is the first failure (numFailures == 1
) then there would have been no opportunity to send a warning previously.
reading through this, makes sense to have that logic in warningPreviouslySentForMaxDays
and i can just pass in numFailures
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.
Cool, that makes sense and yep, agreed that the logic sounds right in warningPreviouslySentForMaxDays()
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 makes sense to me, assuming you'll move that > 1
check inside the helper!
* Adjust auto-disable connection logic for spam * refactor for readability
What
address #12287
tldr: adds logic so if we send a warning for 50 failures in a row, we don't send another warning if there have been only failures in the past 7 days, and vice-versa.