Skip to content

Conversation

@adamcfraser
Copy link
Collaborator

Copilot AI review requested due to automatic review settings November 28, 2025 21:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors lock management in the LRU revision cache by consistently using defer statements for unlocks. The changes improve code safety by ensuring locks are released even if early returns or panics occur, reducing the risk of deadlocks. This is a backport to the 4.0.2 branch.

Key changes:

  • Converted manual Unlock() calls to defer pattern across multiple functions
  • Refactored Upsert() by extracting cache operations into a new upsertDocToCache() helper function
  • Removed early return statements that required explicit lock releases

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