Skip to content

fix: remove global lock optimization to align with Git#2674

Merged
Sebastian Thiel (Byron) merged 1 commit into
mainfrom
fix-ref-transaction-toctou
Jun 23, 2026
Merged

fix: remove global lock optimization to align with Git#2674
Sebastian Thiel (Byron) merged 1 commit into
mainfrom
fix-ref-transaction-toctou

Conversation

@Byron

@Byron Sebastian Thiel (Byron) commented Jun 23, 2026

Copy link
Copy Markdown
Member

Previously, a transaction would rely on the packed-refs lock
only when available, and skip per-ref locks entirely.

This would, however, incorrectly serialise ref writers globally,
giving it the same write performance as ref-tables, while allowing
races with Git processes.

Follow-up to #2659

Previously, a transaction would rely on the packed-refs lock
only when available, and skip per-ref locks entirely.

This would, however, incorrectly serialise ref writers globally,
giving it the same write performance as ref-tables, while allowing
races with Git processes.

Co-authored-by: Sebastian Thiel <sebastian.thiel@icloud.com>
Copilot AI review requested due to automatic review settings June 23, 2026 15:17

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Byron

Copy link
Copy Markdown
Member Author

This may very well have performance implication, but it would only be noticeable when fetching tremendous amounts of loose refs to write them, and… these would go directly to packed-refs anyway.

Maybe back then, this optimisation didn't exist yet. So let's just fix it before an issue pops up.

@Byron Sebastian Thiel (Byron) merged commit 7471d07 into main Jun 23, 2026
32 checks passed
@Byron Sebastian Thiel (Byron) deleted the fix-ref-transaction-toctou branch June 23, 2026 16:25
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.

3 participants