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

Adjust auto-disable connection logic for spam #12288

Merged
merged 2 commits into from
Apr 27, 2022

Conversation

terencecho
Copy link
Contributor

@terencecho terencecho commented Apr 22, 2022

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.

@github-actions github-actions bot added area/platform issues related to the platform area/worker Related to worker labels Apr 22, 2022
@terencecho terencecho temporarily deployed to more-secrets April 23, 2022 01:18 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 23, 2022 01:18 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 25, 2022 16:37 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 25, 2022 16:37 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 26, 2022 22:15 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 26, 2022 22:15 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 26, 2022 22:32 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 26, 2022 22:32 Inactive
@@ -73,13 +75,16 @@ public AutoDisableConnectionOutput autoDisableFailingConnection(final AutoDisabl
}
}

final boolean warningPreviouslySentForMaxDays =
numFailures > 1 && warningPreviouslySentForMaxDays(successTimestamp, maxDaysOfOnlyFailedJobsBeforeWarning, firstJob, jobs);
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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()

Copy link
Contributor

@pmossman pmossman left a 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!

@terencecho terencecho temporarily deployed to more-secrets April 27, 2022 00:10 Inactive
@terencecho terencecho temporarily deployed to more-secrets April 27, 2022 00:10 Inactive
@terencecho terencecho merged commit c856d79 into master Apr 27, 2022
@terencecho terencecho deleted the tcho/12287-adjust-auto-disable-connection branch April 27, 2022 00:35
suhomud pushed a commit that referenced this pull request May 23, 2022
* Adjust auto-disable connection logic for spam

* refactor for readability
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/platform issues related to the platform area/worker Related to worker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust auto-disable connection logic to only warn a user once if they meet both warning criteria
2 participants