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

Remove CrossProcessReaderWriteLock #3549

Merged
merged 2 commits into from
Aug 25, 2023

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Aug 24, 2023

Change

Remove CrossProcessReaderWriteLock, as it has caused more problems than it likely ever solved.

The current issue is that the mutexes can potentially be released on a different thread than they were acquired in the COM server. This led to initially removing them from being stored for the entire lifetime of the index file, after confirming that even in immutable mode, SQLite is opening the file and not sharing delete.

After that, the massive complexity of the code is unnecessary, since we ever only hold the lock shared to open the index. So rather than keep it, I swapped out all usage for the simple wrapper around a named mutex. I also added a FAIL_FAST_IF the current thread was not the one that we had originally acquired the lock on.

This might lead to slightly more waiting while other callers are opening files, but it might just as easily lead to less waiting due to the single mutex.

Validation

By existing tests.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner August 24, 2023 03:50
@JohnMcPMS JohnMcPMS merged commit d108332 into microsoft:master Aug 25, 2023
8 checks passed
@JohnMcPMS JohnMcPMS deleted the prevent-deadlock branch August 25, 2023 18:36
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.

None yet

2 participants