Skip to content

Concurrently cloning advisories database fails #479

@djc

Description

@djc

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.liu-huaimin.workers.dev-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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions