Improve reporting from account purger cronjob#30959
Merged
Merged
Conversation
islemaster
added a commit
that referenced
this pull request
Oct 3, 2019
Due to an increase in intermittent Pardot errors, we recently [made some QueuedAccountPurges autoretryable](#30909). (See also [this change to reporting from this task](#30959).) To our surprise, the queue depth still continued to increase. It turns out the auto-retry was working, but the `QueuedAccountPurge` records associated with the retried accounts were not being cleared. This change adds a step right at the end of the nightly task to clean up any resolved `QueuedAccountPurge` records. One benefit of this design is that it will retroactively clean up our queue on production next time it runs, so no manual correction to the production database is required.
7 tasks
Hamms
approved these changes
Oct 22, 2019
Contributor
Hamms
left a comment
There was a problem hiding this comment.
Couple of nits, but otherwise this looks great! Love the testing, too
| end | ||
|
|
||
| def report_results | ||
| review_queue_depth = manual_review_queue_depth |
Contributor
There was a problem hiding this comment.
is this method no longer needed?
Contributor
Author
There was a problem hiding this comment.
Nice catch, thanks.
| end | ||
|
|
||
| # Send warning messages to #cron-daily and #user-accounts | ||
| def notify(message) |
Contributor
There was a problem hiding this comment.
should this be something like "warn"?
Contributor
Author
There was a problem hiding this comment.
👍 Yeah, that's what it looks like.
14af6a4 to
2e31c19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I recently added support for auto-retrying certain Queued Account Purges because we were seeing quite a bit of noise from intermittent Pardot API failures. However, our daily reporting in Slack wasn't updated to accurately communicate when no developer intervention was needed:
Here, I'm making some changes to make this daily reporting more accurate, and to help the right people notice and respond when action is required.
#user-accountsand color-code the message yellow.#user-accountsand color-code the message red.Testing
Unit tests updated to check that appropriate logs are generated in different scenarios (this shares a lot of code with the Slack notifications).