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 AndroidProfiler and SentryTracer crashes #2731

Merged
merged 2 commits into from
May 25, 2023
Merged

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented May 24, 2023

📜 Description

A customer reported these 2 crashes internally, so this PR simply fixes/swallows them. Most likely they were caused by calling Sentry.close() in the middle of processing transactions.

  • The synchronized in AndroidTransactionProfiler should actually fix the root cause, but I've also added the null check just to make sure
  • For SentryTracer fix we just swallow the exception and finish the transaction immediately if we failed to schedule the finish timer

image
image

💚 How did you test it?

Manually and automated

📝 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 May 24, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 289.02 ms 373.63 ms 84.61 ms
Size 1.72 MiB 2.28 MiB 570.67 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
46b1782 387.72 ms 458.74 ms 71.02 ms
1707044 338.80 ms 384.79 ms 46.00 ms

App size

Revision Plain With Sentry Diff
46b1782 1.72 MiB 2.28 MiB 570.44 KiB
1707044 1.72 MiB 2.28 MiB 570.44 KiB

@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Patch coverage: 92.30% and project coverage change: +0.01 🎉

Comparison is base (a485ab0) 81.11% compared to head (c4f49fc) 81.13%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2731      +/-   ##
============================================
+ Coverage     81.11%   81.13%   +0.01%     
- Complexity     4447     4449       +2     
============================================
  Files           345      345              
  Lines         16394    16402       +8     
  Branches       2226     2226              
============================================
+ Hits          13298    13307       +9     
  Misses         2168     2168              
+ Partials        928      927       -1     
Impacted Files Coverage Δ
sentry/src/main/java/io/sentry/SentryTracer.java 94.96% <92.30%> (+0.51%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@romtsn romtsn merged commit 5041902 into main May 25, 2023
@romtsn romtsn deleted the rz/fix/perf-crashes branch May 25, 2023 09:10
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.

None yet

2 participants