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

Add advisory lock for registry cache db #1712

Merged
merged 1 commit into from
Nov 4, 2024
Merged

Conversation

maciektr
Copy link
Contributor

@maciektr maciektr commented Oct 31, 2024

redb will try to lock the db file, with exclusive lock. When exclusive lock cannot be acquired (e.g. when another Scarb process is using the db file simultaneously), Scarb will then remove the file completely and try to recreate it.

This PR adds an advisory lock which synchronizes access to the db file between Scarb processes, so the lock can always be acquired.

https://github.com/cberner/redb/blob/9ffa1d13dad343a8937a55540424dcfa45375a09/src/tree_store/page_store/file_backend/unix.rs#L37

@maciektr maciektr added this pull request to the merge queue Nov 4, 2024
Merged via the queue into main with commit 2a36f5f Nov 4, 2024
22 checks passed
@maciektr maciektr deleted the maciektr/registry-db-lock branch November 4, 2024 10:32
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.

3 participants