-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(crons): Use timeout_at for timed out check-ins #52570
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
Conversation
"monitor", "monitor_environment" | ||
)[:CHECKINS_LIMIT] | ||
qs = MonitorCheckIn.objects.filter( | ||
status=CheckInStatus.IN_PROGRESS, timeout_at__lte=current_datetime |
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.
would it be worth changing the query to
Q(timeout_at__lte=current_datetime) | Q(timeout_at=None)
as a safety precaution? we don't have any null values currently but would be a good protection in case there's a regression so we don't ignore the null timeouts. could also put it in a separate query
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.
Hmmm. Maybe we can add a metric that we put an alert on?
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'll run a query and raise an exception at the bottom as a safety check
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #52570 +/- ##
==========================================
- Coverage 79.46% 77.82% -1.64%
==========================================
Files 4936 4938 +2
Lines 207430 207943 +513
Branches 35425 35499 +74
==========================================
- Hits 164834 161835 -2999
- Misses 37559 41027 +3468
- Partials 5037 5081 +44
|
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.
Looks like a great change to me
Queries off of timestamp of
timeout_at
for in progress check-insCloses #52563