-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(aci): Write to IncidentGroupOpenPeriod #97906
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
alert_id = AlertRuleDetector.objects.get(detector_id=detector_id).alert_rule_id | ||
else: |
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.
Potential bug: The call to AlertRuleDetector.objects.get()
lacks error handling, which will cause a server crash if the object does not exist, breaking issue ingestion.
-
Description: The method
create_from_occurrence
callsAlertRuleDetector.objects.get(detector_id=detector_id)
without handling theAlertRuleDetector.DoesNotExist
exception. Thedetector_id
value, derived fromoccurrence.evidence_data
, can be missing or invalid. Other parts of the codebase, such as insrc/sentry/incidents/grouptype.py
, consistently wrap similar queries intry...except
blocks, establishing a pattern that this is a known and expected failure case. An unhandledDoesNotExist
exception will propagate up the call stack, causing a server crash during the critical issue ingestion process. -
Suggested fix: Wrap the
AlertRuleDetector.objects.get()
call in atry...except AlertRuleDetector.DoesNotExist
block. In theexcept
block, log a warning and handle the case gracefully, for example by settingalert_id
toNone
and allowing execution to continue. This matches established patterns elsewhere in the codebase.
severity: 0.85, confidence: 0.95
Did we get this right? 👍 / 👎 to inform future reviews.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #97906 +/- ##
=======================================
Coverage 80.65% 80.65%
=======================================
Files 8591 8591
Lines 378854 378910 +56
Branches 24660 24660
=======================================
+ Hits 305561 305611 +50
- Misses 72924 72930 +6
Partials 369 369 |
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.
flag looks good, hopefully we can learn some more about the problems by easing in traffic 🙏
#97697 but it's behind a feature flag this time so we can toggle it on and off, plus converts incident projects to a list rather than passing a queryset. See [this commit](cd0b7f9) for the only change in this from the original implementation. --------- Co-authored-by: Snigdha Sharma <[email protected]>
#97697 but it's behind a feature flag this time so we can toggle it on and off, plus converts incident projects to a list rather than passing a queryset. See [this commit](cd0b7f9) for the only change in this from the original implementation. --------- Co-authored-by: Snigdha Sharma <[email protected]>
Suspect IssuesThis pull request was deployed and Sentry observed the following issues:
Did you find this useful? React with a 👍 or 👎 |
#97697 but it's behind a feature flag this time so we can toggle it on and off, plus converts incident projects to a list rather than passing a queryset. See [this commit](cd0b7f9) for the only change in this from the original implementation. --------- Co-authored-by: Snigdha Sharma <[email protected]>
#97697 but it's behind a feature flag this time so we can toggle it on and off, plus converts incident projects to a list rather than passing a queryset. See [this commit](cd0b7f9) for the only change in this from the original implementation. --------- Co-authored-by: Snigdha Sharma <[email protected]>
#97697 but it's behind a feature flag this time so we can toggle it on and off, plus converts incident projects to a list rather than passing a queryset. See this commit for the only change in this from the original implementation.