-
-
Notifications
You must be signed in to change notification settings - Fork 435
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 ensure ndk libs are loaded before calling close #3797
Conversation
Performance metrics 🚀
|
@@ -69,6 +69,15 @@ public static void init(@NotNull final SentryAndroidOptions options) { | |||
|
|||
/** Closes the NDK integration */ | |||
public static void close() { | |||
shutdown(); | |||
try { | |||
if (loadLibraryLatch.await(2000, TimeUnit.MILLISECONDS)) { |
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.
this could slow down on SDK restart/double init
i'd rather submit the shutdown() to the same thread we use to load the libraries
wdyt?
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.
I thinks it's fine this way because .init()
already waits for the latch to finish, so whenever .close()
is called the latch is already counted down. So even a double init wouldn't cause this to be blocking, unless you call SentryAndroid.init()
from different threads in parallel 😅
So the .await()
will only be blocking in case SentryNdk.close()
is called before SentryNdk.init()
- in theory this should never happen.
📜 Description
Ensures the NDK libs are loaded, just like within
.init()
. The NDK integration itself already swallows any thrown exception, so there should be no change in that regard.💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps
#skip-changelog