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

[ios] Fix offline-related crash #4934

Merged
merged 1 commit into from Jan 16, 2023

Conversation

charlag
Copy link
Contributor

@charlag charlag commented Jan 5, 2023

It seems like the reason for the crash in 4836 is concurrent access to the db pointer. When we run into the outdated credentials we close the db and it can happen while another operation is running. The crash was happening when get() would check that db is open and copy the db handle, the db would be closed in the meantime and then get() would fail when it would try to use the db. The only way to prevent this is to make all db usage serial and we achieve this by using actor. This probably impacts the performance because there can be no more concurrent calls but we believe that the impact is minimal in practice.

fix #4836

It seems like the reason for the crash in 4836 is concurrent access
to the db pointer. When we run into the outdated credentials we close
the db and it can happen while another operation is running. The crash
was happening when get() would check that db is open and copy the db
handle, the db would be closed in the meantime and then get() would
fail when it would try to use the db. The only way to prevent this is
to make all db usage serial and we achieve this by using actor. This
probably impacts the performance because there can be no more concurrent
calls but we believe that the impact is minimal in practice.

fix #4836
@charlag charlag requested a review from ganthern January 5, 2023 13:17
Copy link
Contributor

@ganthern ganthern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems to do what it says it does

@ganthern ganthern changed the base branch from master to 3.108.0-integration January 16, 2023 12:20
@ganthern ganthern merged commit a558c6e into 3.108.0-integration Jan 16, 2023
@ganthern ganthern deleted the fix-ios-offline-crash-4836 branch January 16, 2023 12:20
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.

app crashes after login when the session for saved premium credentials is deleted from another device
2 participants