Skip to content
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

Trim stacktraces to <200 frames before attempting to construct POJOs #1281

Merged
merged 2 commits into from
Jun 21, 2021

Conversation

fractalwrench
Copy link
Contributor

@fractalwrench fractalwrench commented Jun 21, 2021

Goal

The notifier trims stacktraces so that they contain a maximum of 200 frames. This means that very large stacktraces such as StackOverflowError do not exceed the API's payload limit.

This change ensures that the traces are trimmed before constructing POJOs, which reduces unnecessary object instantiation in this scenario.

Changeset

  • Converted stacktraceFromJavaTrace companion object function into a constructor
  • Ensured that both constructors in Stacktrace trim traces to a maximum of 200 frames

Testing

Added unit test for new constructor.

@fractalwrench fractalwrench changed the title Trim stacktraces before constructing POJOs Trim stacktraces before attempting to construct POJOs Jun 21, 2021
@fractalwrench fractalwrench changed the title Trim stacktraces before attempting to construct POJOs Trim stacktraces to <200 frames before attempting to construct POJOs Jun 21, 2021
@fractalwrench fractalwrench force-pushed the PLAT-6746/trim-stacktrace-early branch from 81d8ab6 to eb094e9 Compare June 21, 2021 10:44
@fractalwrench fractalwrench marked this pull request as ready for review June 21, 2021 11:03
Copy link
Contributor

@lemnik lemnik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

…ace.kt

Co-authored-by: Jason <lemnik@users.noreply.github.com>
@fractalwrench fractalwrench merged commit 78fb689 into next Jun 21, 2021
@fractalwrench fractalwrench deleted the PLAT-6746/trim-stacktrace-early branch June 21, 2021 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants