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

locking behaviour improvements #146

Merged
merged 4 commits into from
Aug 2, 2023
Merged

locking behaviour improvements #146

merged 4 commits into from
Aug 2, 2023

Conversation

Byron
Copy link
Collaborator

@Byron Byron commented Aug 1, 2023

Related to #62 .

See what should be done about locking.

Improve docs

  • doc the current behaviour
  • consider removing the locking and leave it to the users

Byron added 4 commits August 1, 2023 07:57
…hen opening a git index.

Previously, to allow concurrently opening and possibly updating a crates-index, a file-lock was
used for synchronization. However, it was rather specific to what the test-suite needed while
adding another failure mode for production code which could leave lock-files behind that then
lock the crates-index forever for this library at least.

Instead, appropriate locking will be used in tests only, while the documentation of all
`open` methods of `GitIndex` was adjusted to inform about ways to protect concurrent accesses
on application level.
Previously, discovery was used which may traverse the directory structure
upwards to find the index. This may be error prone as the index location is
supposed to be well-known.

Now the index path provided must either be `.../index` or `.../index.git` to be
opened successfully.
…pen without cloning.

These methods are naturally read-only and thus have no issues in concurrent contexts, while
not providing an option to not auto-clone a whole index.
@Byron Byron merged commit d8fc1c1 into master Aug 2, 2023
@Byron Byron deleted the locking branch August 2, 2023 08:58
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