mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-12-01 07:05:24 +00:00
Each trivy scan updated the vulnerability database when the database was stale. Six concurrent rescans then downloaded it at the same time. A download took about 11 seconds alone and 38 seconds under contention. Five of six trivy processes crashed with SIGBUS, because they read a database that another process replaced. The other scans hit their timeout. Scans now run with --skip-db-update. A refresh loop updates the database every 6 hours (trivy.db_update_interval). Scans hold a read lock and an update holds the write lock, so an update never replaces the database under a running scan. A scan that finds no database downloads it once before it scans. The grype refresh loop moves to the dbrefresh package, which both scanners use.