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: Updating AppHang state on main thread #2793

Merged
merged 2 commits into from
Mar 15, 2023

Conversation

philipphofmann
Copy link
Member

📜 Description

Move updating the app hang state to a background thread for anrStopped.

💡 Motivation and Context

It came up while investigating #2791

💚 How did you test it?

Unit tests and on a real device.

📝 Checklist

You have to check all boxes before merging:

  • 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

Move updating the app hang state to a background thread for anrStopped.
@github-actions
Copy link

github-actions bot commented Mar 14, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1243.26 ms 1264.60 ms 21.34 ms
Size 20.76 KiB 427.35 KiB 406.59 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
bd2afa6 1192.31 ms 1210.37 ms 18.05 ms
7fb7afb 1235.00 ms 1256.81 ms 21.81 ms
3389927 1230.12 ms 1238.04 ms 7.92 ms
0dedab7 1221.26 ms 1235.34 ms 14.08 ms
ff09c7e 1240.94 ms 1262.66 ms 21.72 ms
fdfe96b 1227.90 ms 1242.56 ms 14.66 ms
f8fc36d 1226.31 ms 1247.80 ms 21.49 ms
4d6f273 1195.63 ms 1232.22 ms 36.59 ms
25bcc50 1237.69 ms 1258.40 ms 20.71 ms
8cb9355 1225.23 ms 1231.22 ms 5.99 ms

App size

Revision Plain With Sentry Diff
bd2afa6 20.76 KiB 420.55 KiB 399.79 KiB
7fb7afb 20.76 KiB 419.69 KiB 398.94 KiB
3389927 20.76 KiB 427.23 KiB 406.46 KiB
0dedab7 20.76 KiB 420.00 KiB 399.24 KiB
ff09c7e 20.76 KiB 427.76 KiB 407.00 KiB
fdfe96b 20.76 KiB 419.70 KiB 398.95 KiB
f8fc36d 20.76 KiB 419.70 KiB 398.94 KiB
4d6f273 20.76 KiB 426.93 KiB 406.17 KiB
25bcc50 20.76 KiB 427.23 KiB 406.46 KiB
8cb9355 20.76 KiB 419.70 KiB 398.95 KiB

Previous results on branch: fix/app-hang-stop-main-thread

Startup times

Revision Plain With Sentry Diff
d3e138e 1228.04 ms 1243.32 ms 15.28 ms

App size

Revision Plain With Sentry Diff
d3e138e 20.76 KiB 427.33 KiB 406.57 KiB

@codecov
Copy link

codecov bot commented Mar 14, 2023

Codecov Report

Merging #2793 (7de28ad) into main (f715499) will decrease coverage by 0.03%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2793      +/-   ##
==========================================
- Coverage   81.23%   81.20%   -0.03%     
==========================================
  Files         257      257              
  Lines       24206    24204       -2     
  Branches    10776    10774       -2     
==========================================
- Hits        19664    19656       -8     
- Misses       4044     4050       +6     
  Partials      498      498              
Impacted Files Coverage Δ
Sources/Sentry/SentryANRTracker.m 100.00% <100.00%> (ø)

... and 10 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f715499...7de28ad. Read the comment docs.

Copy link
Member

@armcknight armcknight left a comment

Choose a reason for hiding this comment

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

I'm just not sure about whether we want to delay gathering stack traces. It might remove our own code frames, but might make the feature less useful in general.

Sources/Sentry/SentryANRTracker.m Show resolved Hide resolved
@philipphofmann philipphofmann merged commit 06548c0 into main Mar 15, 2023
@philipphofmann philipphofmann deleted the fix/app-hang-stop-main-thread branch March 15, 2023 15:47
@github-actions
Copy link

Fails
🚫 Please consider adding a changelog entry for the next release.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

- Updating AppHang state on main thread ([#2793](https://github.com/getsentry/sentry-cocoa/pull/2793))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description.

Generated by 🚫 dangerJS against 20dbe91

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.

3 participants