-
Notifications
You must be signed in to change notification settings - Fork 3
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
Parse Exception Handling #3080
Parse Exception Handling #3080
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #3080 +/- ##
===========================================
- Coverage 93.02% 92.71% -0.31%
===========================================
Files 277 277
Lines 7426 7486 +60
Branches 661 672 +11
===========================================
+ Hits 6908 6941 +33
- Misses 415 443 +28
+ Partials 103 102 -1
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
- updated messaging language a bit
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.
Error language looks good
except Exception as e: | ||
logger.error(f"Encountered error while creating datafile records: {e}") | ||
log_parser_exception(datafile, | ||
f"Encountered generic exception while creating database records: \n{e}", |
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 was able to trigger this exception, but it doesn't generate an exception-related email notification.
@@ -20,28 +22,51 @@ def parse(data_file_id, should_send_submission_email=True): | |||
# passing the data file FileField across redis was rendering non-serializable failures, doing the below lookup | |||
# to avoid those. I suppose good practice to not store/serializer large file contents in memory when stored in redis | |||
# for undetermined amount of time. | |||
data_file = DataFile.objects.get(id=data_file_id) | |||
try: |
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 want to confirm the logic here. Are the following steps accurate?
- file parsing starts and status is set to
Pending
during this process. - parsing processing completes and the status of parsing is retrieved from summary object
- parsing metadata from the summary object retrieved
- data submission email sent to approved users associated with the file/STT
if an exception is encountered along the way (i assume during parsing?):
- if its a database exception, the exception is logged (in LogEntries?) and the task exits
- if some other exception, a generic exception-related error message is added to the feedback report, parsing status is set to Rejected, the exception is logged (in LogEntries?), and the task exits.
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.
That is correct, would it make more sense to have both exception blocks perform the same handling? I.e LogEntry creation, reject file, and generate an error? Just for clarity, we generate the error to ensure the STT has the required info to notify an admin of the issue since we don't have a monitoring solution or email based solution in place yet.
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.
@elipe17 this is approved 🚀 Below are some notes from our asyncs:
- We were able to trigger a generic uncaught exception with a tribal closed file, and another bug ticket is needed to address it. In the meantime, we confirmed that an actionable error message is included in the error report.
- "Stress-testing" the system by submitting large files with lots of errors detected did trigger the exceptions related to
ConnectionTimeout
andTransportError
errors which were added to the logentries as expected, but the files continue to be stuck in aPending
state, and as shown below, appears to also be associated with the worker terminating prematurely. Spike - Investigate celery worker terminating prematurely #3144 will track investigations into the worker terminating, and in the meantime, the logentries can help with tracking the incidence of these exceptions and any associations with the worker.
- I have not yet been able to introduce an uncaught exception-related error into the feedback report for STTs. We'll monitor this in prod.
Summary of Changes
parse.py
to more gracefully handle all types of exceptionsPull request closes Service timeout blocks parsing completion #3055
How to Test
cf unbind-service <BACKEND_APP_NAME> <ES_SERVICE_NAME>
Deliverables
More details on how deliverables herein are assessed included here.
Deliverable 1: Accepted Features
Checklist of ACs:
Deliverable 2: Tested Code
CodeCov Report
comment in PR)CodeCov Report
comment in PR)Deliverable 3: Properly Styled Code
Deliverable 4: Accessible
iamjolly
andttran-hub
using Accessibility Insights reveal any errors introduced in this PR?Deliverable 5: Deployed
Deliverable 6: Documented
Deliverable 7: Secure
Deliverable 8: User Research
Research product(s) clearly articulate(s):