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 hub restore in async wrappers #3225

Merged
merged 6 commits into from
Feb 26, 2024
Merged

Fix hub restore in async wrappers #3225

merged 6 commits into from
Feb 26, 2024

Conversation

lbloder
Copy link
Collaborator

@lbloder lbloder commented Feb 26, 2024

📜 Description

Fix restore point for hub in async wrappers

  • SentryWrapper
  • SentryScheduleHook
  • SentryTaskDecorator

💡 Motivation and Context

Fixes #3177

💚 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

Copy link
Contributor

github-actions bot commented Feb 26, 2024

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 0e18457

@lbloder lbloder changed the title Fix hub restoration in wrappers: SentryWrapper, SentryTaskDecor… Fix hub restore in wrappers Feb 26, 2024
@lbloder lbloder changed the title Fix hub restore in wrappers Fix hub restore in async wrappers Feb 26, 2024
Copy link
Contributor

github-actions bot commented Feb 26, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 468.92 ms 570.19 ms 101.27 ms
Size 1.70 MiB 2.28 MiB 587.99 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
0810952 364.51 ms 468.08 ms 103.57 ms
2fad834 390.07 ms 470.80 ms 80.73 ms
2465853 422.61 ms 491.20 ms 68.58 ms
8ff8fd0 432.77 ms 495.18 ms 62.41 ms
2465853 400.64 ms 465.47 ms 64.83 ms
5e04ee8 365.26 ms 448.49 ms 83.23 ms
c554ca2 368.52 ms 430.74 ms 62.22 ms
4e29063 384.14 ms 447.74 ms 63.60 ms
0404ea3 394.73 ms 461.79 ms 67.06 ms
0404ea3 332.47 ms 401.12 ms 68.66 ms

App size

Revision Plain With Sentry Diff
0810952 1.72 MiB 2.27 MiB 558.21 KiB
2fad834 1.72 MiB 2.29 MiB 577.53 KiB
2465853 1.70 MiB 2.27 MiB 583.82 KiB
8ff8fd0 1.72 MiB 2.27 MiB 558.15 KiB
2465853 1.70 MiB 2.27 MiB 583.82 KiB
5e04ee8 1.70 MiB 2.27 MiB 584.64 KiB
c554ca2 1.70 MiB 2.27 MiB 582.25 KiB
4e29063 1.72 MiB 2.29 MiB 578.38 KiB
0404ea3 1.72 MiB 2.29 MiB 577.52 KiB
0404ea3 1.72 MiB 2.29 MiB 577.52 KiB

Previous results on branch: feat/task-decorator-fix

Startup times

Revision Plain With Sentry Diff
1079568 399.44 ms 458.76 ms 59.32 ms
eaefb42 392.00 ms 460.92 ms 68.92 ms

App size

Revision Plain With Sentry Diff
1079568 1.70 MiB 2.28 MiB 587.99 KiB
eaefb42 1.70 MiB 2.28 MiB 587.99 KiB

@lbloder lbloder marked this pull request as ready for review February 26, 2024 11:07
@adinauer adinauer self-assigned this Feb 26, 2024
Copy link
Member

@adinauer adinauer left a comment

Choose a reason for hiding this comment

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

LGTM, just some small things.

CHANGELOG.md Show resolved Hide resolved
@AfterTest
fun beforeTest() {
Sentry.close()
SentryCrashLastRunState.getInstance().reset()
Copy link
Member

Choose a reason for hiding this comment

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

l do we need this?


class SentryTaskDecoratorTest {
private val dsn = "http://key@localhost/proj"
private val executor = Executors.newSingleThreadExecutor()
Copy link
Member

Choose a reason for hiding this comment

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

l should we shut it down after tests?

fun `hub is reset to its state within the thread after decoration is done`() {
Sentry.init {
it.dsn = dsn
it.beforeSend = SentryOptions.BeforeSendCallback { event, hint ->
Copy link
Member

Choose a reason for hiding this comment

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

l can we remove this?

lbloder and others added 2 commits February 26, 2024 14:52
Co-authored-by: Alexander Dinauer <adinauer@users.noreply.github.com>
@lbloder lbloder merged commit aa91b8f into main Feb 26, 2024
24 checks passed
@lbloder lbloder deleted the feat/task-decorator-fix branch February 26, 2024 14:19
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.

SentryTaskDecorator cleanup
2 participants