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 in Tracer for idle timeout #2834

Merged
merged 3 commits into from
Mar 24, 2023

Conversation

philipphofmann
Copy link
Member

📜 Description

dispatch_block_create can return NULL. If it does, we finish the transaction and don't schedule the timeout.

💡 Motivation and Context

Fixes GH-2832, GH-2769

💚 How did you test it?

Unit tests, and on an iPhone to validate UI event transactions are still working properly.

📝 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

dispatch_block_create can return NULL. If it does we finish
the transaction and don't schedule the timeout.

Fixes GH-2832, GH-2769
@github-actions
Copy link

github-actions bot commented Mar 24, 2023

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 6250.58 ms 6269.63 ms 19.05 ms
Size 20.76 KiB 426.11 KiB 405.34 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
49819af 1263.92 ms 1275.66 ms 11.74 ms
8f397a7 1230.10 ms 1253.88 ms 23.77 ms
fdfe96b 1227.90 ms 1242.56 ms 14.66 ms
d40512b 1231.12 ms 1244.54 ms 13.42 ms
c9724f9 1199.38 ms 1229.54 ms 30.16 ms
28333b6 1247.29 ms 1262.51 ms 15.22 ms
f576153 1210.02 ms 1228.94 ms 18.92 ms
0dedab7 1221.26 ms 1235.34 ms 14.08 ms
bd2afa6 1241.37 ms 1246.20 ms 4.83 ms
10ee2ce 1250.90 ms 1258.57 ms 7.67 ms

App size

Revision Plain With Sentry Diff
49819af 20.76 KiB 427.31 KiB 406.55 KiB
8f397a7 20.76 KiB 420.55 KiB 399.79 KiB
fdfe96b 20.76 KiB 419.70 KiB 398.95 KiB
d40512b 20.76 KiB 427.77 KiB 407.00 KiB
c9724f9 20.76 KiB 427.66 KiB 406.90 KiB
28333b6 20.76 KiB 424.69 KiB 403.93 KiB
f576153 20.76 KiB 425.77 KiB 405.01 KiB
0dedab7 20.76 KiB 420.00 KiB 399.24 KiB
bd2afa6 20.76 KiB 420.55 KiB 399.79 KiB
10ee2ce 20.76 KiB 427.77 KiB 407.00 KiB

Previous results on branch: fix/crash-in-tracer-idle-timeout

Startup times

Revision Plain With Sentry Diff
ff0832c 1233.57 ms 1256.45 ms 22.88 ms

App size

Revision Plain With Sentry Diff
ff0832c 20.76 KiB 426.14 KiB 405.38 KiB

Copy link
Contributor

@brustolin brustolin left a comment

Choose a reason for hiding this comment

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

Looks good.

Just one suggestion.

Comment on lines 228 to 230
SENTRY_LOG_WARN(@"Couln't create idle time out block. Can't schedule idle timeout. "
@"Finishing transaction");
[self finishInternal];
Copy link
Contributor

Choose a reason for hiding this comment

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

m: I would just add a comment here that the transaction will not be send because it does not have any child.

Copy link
Member Author

Choose a reason for hiding this comment

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

Better now?

@codecov
Copy link

codecov bot commented Mar 24, 2023

Codecov Report

Merging #2834 (b5bafcd) into main (fb53d97) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2834      +/-   ##
==========================================
- Coverage   81.33%   81.33%   -0.01%     
==========================================
  Files         258      258              
  Lines       24131    24142      +11     
  Branches    10708    10712       +4     
==========================================
+ Hits        19628    19636       +8     
- Misses       4005     4007       +2     
- Partials      498      499       +1     
Impacted Files Coverage Δ
Sources/Sentry/SentryDispatchQueueWrapper.m 100.00% <100.00%> (ø)
Sources/Sentry/SentryTracer.m 96.28% <100.00%> (-0.34%) ⬇️

... and 7 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 fb53d97...b5bafcd. Read the comment docs.

@philipphofmann philipphofmann merged commit 85b619d into main Mar 24, 2023
@philipphofmann philipphofmann deleted the fix/crash-in-tracer-idle-timeout branch March 24, 2023 10:26
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.

We are facing a lot of SDK crashes that have occurred after upgrading to version 8.x.x.
2 participants