-
Notifications
You must be signed in to change notification settings - Fork 536
fix: Don't hang when capturing long stacktrace #4191
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
47f7812
to
09b2f95
Compare
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found.
Additional details and impacted files@@ Coverage Diff @@
## master #4191 +/- ##
==========================================
+ Coverage 79.50% 79.55% +0.05%
==========================================
Files 141 141
Lines 15738 15748 +10
Branches 2675 2679 +4
==========================================
+ Hits 12512 12528 +16
+ Misses 2378 2372 -6
Partials 848 848
|
7e31f86
to
7642fc2
Compare
Fixes #2764
7642fc2
to
2fa2d46
Compare
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 think this looks ok, left a minor comment. I assume you've verified that relay/Sentry has no issues with a None
stacktrace -- if not please do before merging.
Yep, here is an example event with |
Also don't think so, afaik Sentry has been mostly ignoring the |
# Process at most MAX_STACK_FRAMES + 1 frames, to avoid hanging on | ||
# processing a super-long stacktrace. | ||
for tb, _ in zip(iter_stacks(tb), range(MAX_STACK_FRAMES + 1)) | ||
] # type: List[Dict[str, Any]] | ||
|
||
if frames: | ||
if len(frames) > MAX_STACK_FRAMES: | ||
# If we have more frames than the limit, we remove the stacktrace completely. | ||
# We don't trim the stacktrace here because we have not processed the whole | ||
# thing (see above, we stop at MAX_STACK_FRAMES + 1). Normally, Relay would | ||
# intelligently trim by removing frames in the middle of the stacktrace, but | ||
# since we don't have the whole stacktrace, we can't do that. Instead, we | ||
# drop the entire stacktrace. | ||
exception_value["stacktrace"] = AnnotatedValue.removed_because_over_size_limit( | ||
value=None | ||
) |
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.
@sentrivana what do you think about these comments?
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.
lgtm
Fixes #2764