-
Notifications
You must be signed in to change notification settings - Fork 162
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
RCOCOA-2301 Remove the emulated InterprocessMutex File cache #7448
Conversation
Pull Request Test Coverage Report for Build thomas.goyne_254Details
💛 - Coveralls |
f84fd8e
to
87b238a
Compare
How would close affect this? Assertion suggests that the uid for the path has changed somehow. Locking of the static is pretty straight forward here, so something is very fishy. This refactoring is nice, but I feel like it's hiding probably the real problem. Please, add at least the same strong check into mapping where we also use get_file_uid. @ironage what do you think? |
My hypothesis is that the assertion is failing due to the map having an expired shared_ptr, not due to the path changing. This code should be deleted regardless of if it's correct or not, so I don't really see a reason to try to figure out what exactly is broken. |
I think the uses of get_unique_id() in the encryption code should probably go away too. |
87b238a
to
e58e658
Compare
Removing all uses of get_unique_id() sounds like a good idea to me. Issues like #7162 have broken my trust in it and I wouldn't be surprised if there is some other corner case causing issues. Maybe we can just use the file path instead? |
Almost everything does just use the file path and if you break things by deleting a file while it's open and creating a new file at the same path, well that's your problem to deal with. The encryption stuff originally used the inode for performance reasons and not correctness, but those global maps also have no reason to exist any more. They were global because that's the only way to get data to signal handlers, and thankfully we no longer use signal handlers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice reduction in complexity. LGTM.
This was added to reduce the number of file descriptors used back when we opened a separate SharedGroup on each thread. We now normally only ever open one DB per file per process at a time, so sharing files between them is no longer useful.
e58e658
to
1fe358d
Compare
This was added to reduce the number of file descriptors used back when we opened a separate SharedGroup on each thread. We now normally only ever open one DB per file per process at a time, so sharing files between them is no longer useful and it's been the source of a few bugs.
Fixes realm/realm-swift#8507 by just removing the code containing the assertion entirely.