-
-
Notifications
You must be signed in to change notification settings - Fork 448
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 on double SDK init #2679
Changes from 1 commit
960fd20
6af6003
2914bec
7e1be4f
997f4e3
c0607ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
profiling is now stopped on executorService exceptions transaction bound to the scope is not cancelled automatically anymore on Sentry.close() ISentryExecutorService is re-init in Sentry.init if it was shutdown
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -340,18 +340,7 @@ public void close() { | |
} | ||
} | ||
|
||
withScope( | ||
scope -> { | ||
ITransaction transaction = scope.getTransaction(); | ||
if (transaction != null) { | ||
for (Span span : transaction.getSpans()) { | ||
span.setSpanFinishedCallback(null); | ||
span.finish(SpanStatus.CANCELLED); | ||
} | ||
transaction.finish(SpanStatus.CANCELLED); | ||
} | ||
scope.clear(); | ||
}); | ||
withScope(scope -> scope.clear()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. late to the party, but this is not gonna do much, because |
||
options.getTransactionProfiler().close(); | ||
options.getTransactionPerformanceCollector().close(); | ||
options.getExecutorService().close(options.getShutdownTimeoutMillis()); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! I think there's one more test to cover which would fail right now: Initializing the SDK with the same options twice.
I guess the solution here would be to re-init the executor-service in
.init()