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

fix: query for ID before close but compute checksum after #368

Merged
merged 3 commits into from
Aug 22, 2024

Conversation

willmurphyscode
Copy link
Contributor

@willmurphyscode willmurphyscode commented Aug 22, 2024

Otherwise, either the query for the ID will close because the database is closed already, or the checksum will be wrong because closing the database compacts it, which changes its checksum.

See anchore/grype#2076

Otherwise, either the query for the ID will close because the database
is closed already, or the checksum will be wrong because closing the
database compacts it, which changes its checksum.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
This is the test that would have prevented the earlier incorrect
metadata change.

Signed-off-by: Will Murphy <willmurphyscode@users.noreply.github.com>
@wagoodman wagoodman enabled auto-merge (squash) August 22, 2024 14:40
@wagoodman wagoodman merged commit 3b4b4e2 into main Aug 22, 2024
14 checks passed
@wagoodman wagoodman deleted the fix-id-checkum-close branch August 22, 2024 15:10
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.

2 participants