You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running multiple concurrent grype runs, it works for a bit and then I see a spew of SQLite errors that the database is locked.
[0000] WARN matcher failed for pkg=Pkg(type=deb, name=mount, version=2.33.1-0.1ubuntu3, upstreams=1): failed to match by source indirection: failed to find vulnerabilities for dpkg upstream source package: matcher failed to fetch distro="ubuntu 19.04" pkg="util-linux": provider failed to fetch namespace='ubuntu:distro:ubuntu:19.04' pkg='util-linux': database is locked (5) (SQLITE_BUSY)
Emphasis on the end of the error:
database is locked (5) (SQLITE_BUSY)
Running grype sequentially works as expected.
What you expected to happen:
I expect to be able to run multiple grype commands concurrently. If there is contention on a shared resource, the process should wait some reasonable period of time to gain access.
I don't know how SQLite locks work under the hood, but I (admittedly naively) expect a RWLock to allow many concurrent reads while restricting writes. I'm assuming the db is not written to during a scan except when updating the db at the start of a scan (which I have disabled).
How to reproduce it (as minimally and precisely as possible):
What happened:
When running multiple concurrent
grype
runs, it works for a bit and then I see a spew of SQLite errors that the database is locked.Emphasis on the end of the error:
Running
grype
sequentially works as expected.What you expected to happen:
I expect to be able to run multiple
grype
commands concurrently. If there is contention on a shared resource, the process should wait some reasonable period of time to gain access.I don't know how SQLite locks work under the hood, but I (admittedly naively) expect a RWLock to allow many concurrent reads while restricting writes. I'm assuming the db is not written to during a scan except when updating the db at the start of a scan (which I have disabled).
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
Turning on verbose output makes the error less likely, but does not eliminate the possibility.
Grype 0.42 was the last version that seemed to work without this issue. This is presumably a regression caused by #155 or #825
Environment:
grype version
:cat /etc/os-release
or similar): Mac OS 12.5 (21G72)The text was updated successfully, but these errors were encountered: