File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -741,10 +741,18 @@ def single_exception_from_error_tuple(
741741 max_value_length = max_value_length ,
742742 custom_repr = custom_repr ,
743743 )
744+ # Process at most MAX_STACK_FRAMES + 1 frames, to avoid hanging on
745+ # processing a super-long stacktrace.
744746 for tb , _ in zip (iter_stacks (tb ), range (MAX_STACK_FRAMES + 1 ))
745747 ] # type: List[Dict[str, Any]]
746748
747749 if len (frames ) > MAX_STACK_FRAMES :
750+ # If we have more frames than the limit, we remove the stacktrace completely.
751+ # We don't trim the stacktrace here because we have not processed the whole
752+ # thing (see above, we stop at MAX_STACK_FRAMES + 1). Normally, Relay would
753+ # intelligently trim by removing frames in the middle of the stacktrace, but
754+ # since we don't have the whole stacktrace, we can't do that. Instead, we
755+ # drop the entire stacktrace.
748756 exception_value ["stacktrace" ] = AnnotatedValue .removed_because_over_size_limit (
749757 value = None
750758 )
You can’t perform that action at this time.
0 commit comments