Skip to content

SDKs send queue is no longer shutdown immediately on re-init #4564

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

Open
wants to merge 5 commits into
base: feat/e2e-tests-console-otel
Choose a base branch
from

Conversation

adinauer
Copy link
Member

📜 Description

SDKs send queue is no longer shutdown immediately on re-init

💡 Motivation and Context

When re-initializing the SDK, we were:

  • shutting down the queue immediately
  • no longer allow enqueueing new items
  • only added the current item in the queue to the offline cache (if available)
  • discard the other items in the queue

This caused events to be lost in case of re-init, which is common in e.g. Spring Boot + Logback setups.

After the change we are:

  • no longer allowing new items to be enqueued
  • items in the queue will be processed until completion

💚 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

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/AsyncHttpTransport.java

Copy link
Contributor

github-actions bot commented Jul 21, 2025

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

- SDKs send queue is no longer shutdown immediately on re-init ([#4564](https://github.com/getsentry/sentry-java/pull/4564))

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 7cbb0cc

Copy link
Contributor

github-actions bot commented Jul 21, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 456.60 ms 505.83 ms 49.23 ms
Size 1.58 MiB 2.09 MiB 519.47 KiB

Previous results on branch: feat/sdk-re-init-queue-drain

Startup times

Revision Plain With Sentry Diff
5dff751 402.70 ms 471.67 ms 68.97 ms

App size

Revision Plain With Sentry Diff
5dff751 1.58 MiB 2.09 MiB 519.03 KiB

Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/AsyncHttpTransport.java

…c/test/kotlin/sentry/systemtest/ConsoleApplicationSystemTest.kt
Copy link
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/AsyncHttpTransport.java

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.

2 participants