fix: Don't hang when capturing long stacktrace#4191
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
7642fc2 to
2fa2d46
Compare
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.
@sentrivana what do you think about these comments?
Fixes #2764