-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Fix a crash that may occur when resolving a thread-safe reference #8722
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
Conversation
In some cases, resolveThreadSafeReference: can return nil. Usually it happens in highly-concurrent contexts. This can lead to a crash
aehlke
commented
Nov 26, 2024
Who will review and merge this now that Realm is dead?
I thought there are some maintainers that are left?
Overall, we had this problem in our codebase, it was fixed like that and the problem was fixed with it as well
aehlke
commented
Dec 1, 2024
@tgoyne hi - can we get some community members authorized to merge PRs? Thank you
Reporting an error here is incorrect. The TSR resolving to nil means that the object was deleted in between observe()
being called and the notifier being set up, and we can just report that to the block.
I believe you can mitigate this crash by putting all writes on the same global actor, per realm file
I believe you can mitigate this crash by putting all writes on the same global actor, per realm file
that's an option, yes, but for us, we still have realm observations on queue, so we would need to migrate to take advantage of actors.
aehlke
commented
Dec 3, 2024
Yes, I migrated all my Realm usage to actors to resolve crashing instability issues. I recommend it.
In some cases, as per documentation, resolveThreadSafeReference can return nil. It usually happens in highly-concurrent contexts. Checking for nil fixes this crash