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

Close backpressure monitor on SDK shutdown #3998

Merged
merged 28 commits into from
Dec 20, 2024

Conversation

adinauer
Copy link
Member

📜 Description

Close backpressure monitor on SDK shutdown

💡 Motivation and Context

Due to the backpressure monitor rescheduling a task at 10s intervals, there's a very high chance of a task currently being scheduled at any time that takes longer than the shutdownTimeoutMillis (defaulting to 2s) before it'll run. When the SDK shuts down, it'll first ask the ScheduledExecutorService to shutdown, not accepting any more new scheduled jobs but giving already scheduled jobs a chance to run. This means the SDK shutdown will almost always be delayed by the backpressure monitors scheduled job before it forcefully shuts down ScheduledExecutorService after waiting shutdownTimeoutMillis

💚 How did you test it?

📝 Checklist

  • 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.
  • I updated the wizard 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 Dec 18, 2024

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

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

- Close backpressure monitor on SDK shutdown ([#3998](https://github.com/getsentry/sentry-java/pull/3998))

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 18f8d71

Copy link
Contributor

github-actions bot commented Dec 18, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 419.96 ms 439.00 ms 19.04 ms
Size 1.65 MiB 2.31 MiB 676.92 KiB

Baseline results on branch: feat/otel-span-strongref

Startup times

Revision Plain With Sentry Diff
33c9aac 393.47 ms 407.26 ms 13.79 ms
b387fed 417.02 ms 519.06 ms 102.04 ms
c658b5a 410.55 ms 461.18 ms 50.63 ms

App size

Revision Plain With Sentry Diff
33c9aac 1.65 MiB 2.31 MiB 677.05 KiB
b387fed 1.65 MiB 2.31 MiB 677.07 KiB
c658b5a 1.65 MiB 2.31 MiB 677.05 KiB

Previous results on branch: feat/close-backpressure-monitor

Startup times

Revision Plain With Sentry Diff
984abce 391.53 ms 473.72 ms 82.19 ms
c8a8f47 497.30 ms 571.80 ms 74.50 ms

App size

Revision Plain With Sentry Diff
984abce 1.65 MiB 2.31 MiB 676.92 KiB
c8a8f47 1.65 MiB 2.31 MiB 676.91 KiB

Copy link
Collaborator

@lbloder lbloder left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Base automatically changed from feat/otel-span-strongref to 8.x.x December 20, 2024 10:49
@adinauer adinauer merged commit 78415f3 into 8.x.x Dec 20, 2024
14 of 16 checks passed
@adinauer adinauer deleted the feat/close-backpressure-monitor branch December 20, 2024 10:57
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