Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
PoltoraIvana wants to merge 3 commits into realm:master
base: master
Choose a base branch
Loading
from PoltoraIvana:patch-1

Conversation

Copy link

@PoltoraIvana PoltoraIvana commented Nov 26, 2024

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

aehlke commented Nov 26, 2024

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

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

Copy link

aehlke commented Dec 1, 2024

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

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 and PoltoraIvana reacted with thumbs up emoji

Copy link

aehlke commented Dec 3, 2024
edited
Loading

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

Copy link
Author

PoltoraIvana commented Dec 3, 2024
edited
Loading

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.

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

Reviewers

1 more reviewer

@Naveen-C-Ramachandrappa Naveen-C-Ramachandrappa Naveen-C-Ramachandrappa approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /