-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
Transacrion/Span#finish should be thread-safe #1253
Comments
Finish is expected to be called once though |
same for SDK init., still, as discussed, it'd be ideally thread-safe, this gets more important if we decide to create the |
Sentry.init is a static method. An atomic ref swap on SentryEvent isnt' thread-safe and that's OK. Transaction is like SentryEvent. I'd be more worried about something like We need to be clear on what is designed to be accessed concurrently, and what is not. And for an instance type, unless explicitly documented to be thread-safe, assume not to be. For static types it's fair to assume something is thread-safe though, ideally side-effect free even. Ultimately we could have an atomic bool that flips once the Span closes so that we avoid "closing it twice". In the case of Transaction that has the side effect of flushing itself it would have the benefit of not capturing the same transction twice. Even if called sequentially, by the same thread:
|
@bruno-garcia while I don't disagree with your whole explanation, I don't understand what/how made you change your mind from our last call, we've discussed that and we agreed that making also, a |
an example would be this: getsentry/sentry-cocoa#950 (comment) if we go ahead with something like that, IMO |
The method
finish
should be thread-safe as it could be called from multiple threads.cc @Tyrrrz @brustolin
The text was updated successfully, but these errors were encountered: