Skip to content

fix(crafter): release go-git packfile descriptors after repository reads - #3345

Merged
matiasinsaurralde merged 1 commit into
mainfrom
fix/gogit-descriptor-release
Aug 13, 2026
Merged

fix(crafter): release go-git packfile descriptors after repository reads#3345
matiasinsaurralde merged 1 commit into
mainfrom
fix/gogit-descriptor-release

Conversation

@matiasinsaurralde

@matiasinsaurralde matiasinsaurralde commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Closes PFM-6929

Summary

Since the go-git v6 alpha.5 bump (#3336), every PlainOpen* call builds its own 256-entry descriptor pool holding roughly 3 descriptors per packfile, freed only on LRU eviction — which never fires below 256 entries. alpha.4 released them right after each read.

The crafter opens the repository up to twice per attestation init and never closed the storer, so those descriptors stayed open until the process exited. They are now released through storer.IdleReleaser once the reads complete; descriptors reopen lazily, so the repository remains usable.

Review in cubic

go-git v6.0.0-alpha.5 gives every PlainOpen* call its own 256-entry
descriptor pool holding roughly 3 descriptors per packfile
(.pack/.idx/.rev). The pool frees them only on LRU eviction, which never
fires below 256 entries, so the descriptors stayed open for the lifetime
of the process. alpha.4 released them right after each read.

The crafter opens the repository up to twice per attestation init and
never closed the storer, so a heavily packed checkout retained around 48
descriptors per open. Release them explicitly through storer.IdleReleaser
once the reads are done; they reopen lazily, so the repository stays
usable afterwards.

Signed-off-by: Matías Insaurralde <matias@chainloop.dev>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

@matiasinsaurralde
matiasinsaurralde marked this pull request as ready for review August 12, 2026 23:23
@matiasinsaurralde
matiasinsaurralde requested a review from a team August 12, 2026 23:24
@chainloop-platform

chainloop-platform Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Security Checks — ✅ 2 passing

PR info

Status Policy Messages
✅ Passed pr-description-required -
✅ Passed pr-user-story-linked -

⏭️ 3 scans not applied

Scan Reason
vulnerability-scan no manifest/lockfile changed
github-actions-scan no workflow files changed
iac-scan no IaC files changed

View attestation ↗


Powered by Chainloop and Chainloop Trace

@jiparis jiparis left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@matiasinsaurralde
matiasinsaurralde merged commit 02631d6 into main Aug 13, 2026
16 checks passed
@matiasinsaurralde
matiasinsaurralde deleted the fix/gogit-descriptor-release branch August 13, 2026 11:33
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