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

Concurrently cloning advisories database fails #479

Closed
djc opened this issue Nov 8, 2022 · 3 comments · Fixed by #534
Closed

Concurrently cloning advisories database fails #479

djc opened this issue Nov 8, 2022 · 3 comments · Fixed by #534
Labels
bug Something isn't working

Comments

@djc
Copy link

djc commented Nov 8, 2022

I'm setting up CI infrastructure running on our own hardware. After installing cargo deny, we immediately run it. Because multiple jobs might be running in parallel, it's possible for cargo deny to be invoked on different workspaces concurrently. In this case, it seems to fail:

2022-11-08 08:52:08 [ERROR] failed to fetch advisory database https://github.com/RustSec/advisory-db: failed to create locked file '/Users/djc/.cargo/advisory-dbs/github.com-2f857891b7f43c59/.git/config.lock': File exists; class=Os (2); code=Locked (-14)

It would be great if the API was robust to being invoked from different processes concurrently.

To Reproduce
Run cargo deny check twice, concurrently, on a machine that doesn't have the advisories database checked out yet.

Expected behavior
I'd expect the second process to try to wait for a file lock, ensuring that the database is there.

Device:

  • OS: macOS
@djc djc added the bug Something isn't working label Nov 8, 2022
Jake-Shadle added a commit that referenced this issue Jul 28, 2023
This fixes a few issues with advisory dbs, notably ensuring they can be
fetched regardless of the environment, writing `FETCH_HEAD` via
https://docs.rs/tame-index/0.2.4/tame_index/utils/git/fn.write_fetch_head.html,
and properly locking repos before opening/cloning.

Resolves: #479
@djc
Copy link
Author

djc commented Jul 28, 2023

@Jake-Shadle thanks for fixing this! Is there some place I can track the next release?

@Jake-Shadle
Copy link
Member

I'm writing the CHANGELOG right now.

@djc
Copy link
Author

djc commented Jul 28, 2023

Awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants