Skip to content
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 a crash that may occur when resolving a thread-safe reference #8722

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PoltoraIvana
Copy link

In some cases, as per documentation, resolveThreadSafeReference can return nil. It usually happens in highly-concurrent contexts. Checking for nil fixes this crash

In some cases, resolveThreadSafeReference: can return nil. Usually it happens in highly-concurrent contexts. This can lead to a crash
@aehlke
Copy link

aehlke commented Nov 26, 2024

Who will review and merge this now that Realm is dead?

@PoltoraIvana
Copy link
Author

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
Copy link

aehlke commented Dec 1, 2024

@tgoyne hi - can we get some community members authorized to merge PRs? Thank you

@tgoyne
Copy link
Member

tgoyne commented Dec 2, 2024

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.

@aehlke
Copy link

aehlke commented Dec 3, 2024

I believe you can mitigate this crash by putting all writes on the same global actor, per realm file

@PoltoraIvana
Copy link
Author

PoltoraIvana commented Dec 3, 2024

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
Copy link

aehlke commented Dec 3, 2024

Yes, I migrated all my Realm usage to actors to resolve crashing instability issues. I recommend it.

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.

3 participants