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

Fix crash accessing Choreographer instance #2970

Merged
merged 2 commits into from
Oct 11, 2023
Merged

Conversation

stefanosiano
Copy link
Member

📜 Description

choreographer instance is now retrieved in a try/catch block, due to a crash reported by Google Play SDK console

💡 Motivation and Context

Fixes a crash. Closes #2912

💚 How did you test it?

📝 Checklist

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

@github-actions
Copy link
Contributor

github-actions bot commented Oct 5, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 378.18 ms 471.90 ms 93.72 ms
Size 1.72 MiB 2.29 MiB 576.36 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
4d55d51 389.44 ms 471.55 ms 82.11 ms

App size

Revision Plain With Sentry Diff
4d55d51 1.72 MiB 2.29 MiB 576.34 KiB

@codecov
Copy link

codecov bot commented Oct 5, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Files Coverage Δ
...ore/internal/util/SentryFrameMetricsCollector.java 67.18% <55.55%> (-1.15%) ⬇️

📢 Thoughts on this report? Let us know!.

@stefanosiano stefanosiano marked this pull request as ready for review October 5, 2023 15:50
Copy link
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

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

LGTM, please check my comment!

.post(
() -> {
try {
choreographer = Choreographer.getInstance();
Copy link
Member

Choose a reason for hiding this comment

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

Since choregrapher is accessed via a handler outside the main thread I think it's a good idea to mark the field as volatile as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure, since it's only set once and read multiple times. We'd lose memory cache for that.
In the worst case now, when it's read it's still null, so the frame start will fallback to now - frameDuration

@stefanosiano stefanosiano merged commit 4bf95dd into main Oct 11, 2023
20 of 22 checks passed
@stefanosiano stefanosiano deleted the fix/choreographer-crash branch October 11, 2023 13:30
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.

Crash in SentryFrameMetricsCollector
2 participants