Skip to content

Fix potential BSD locking race. #98

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

Merged
merged 2 commits into from
Jun 12, 2024
Merged

Fix potential BSD locking race. #98

merged 2 commits into from
Jun 12, 2024

Conversation

ncruces
Copy link
Owner

@ncruces ncruces commented Jun 12, 2024

In practise, this shouldn't be a big change.

osWriteLock should only fail when going from SHARED to RESERVED (or directly to EXCLUSIVE when recovering a hot journal).

Neither transition invokes the busy handler:
https://github.com/sqlite/sqlite/blob/version-3.46.0/src/pager.c#L3688-L3693

And both transitions should immediately abort any transactions, and invalidate reads made under SHARED.
This change is only motivated by an overabundance of caution.

@ncruces ncruces marked this pull request as ready for review June 12, 2024 19:41
@ncruces ncruces merged commit 3719692 into main Jun 12, 2024
4 checks passed
@ncruces ncruces deleted the bsd branch June 13, 2024 22: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.

1 participant