Skip to content

Conversation

@gregns1
Copy link
Contributor

@gregns1 gregns1 commented Nov 25, 2025

CBG-5022

  • I haven't changed the performEviction function given that has been changed in different PR
  • Please review carefully and watch for anything I may have missed

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

Copilot AI review requested due to automatic review settings November 25, 2025 10:36
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 handling in the LRU revision cache implementation by moving explicit lock.Unlock() calls into deferred statements, improving code safety and maintainability by ensuring locks are always released even if early returns occur.

Key Changes:

  • Converted manual lock releases to defer statements across multiple cache methods
  • Extracted cache insertion logic into a new helper function upsertDocToCache
  • Simplified control flow by removing early returns after lock releases

@bbrks bbrks self-assigned this Nov 26, 2025
@bbrks bbrks merged commit d61ca43 into main Nov 28, 2025
42 checks passed
@bbrks bbrks deleted the CBG-5022 branch November 28, 2025 13: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.

3 participants