Skip to content

Conversation

evan-onyx
Copy link
Contributor

@evan-onyx evan-onyx commented Jun 10, 2025

Description

Fixes https://linear.app/danswer/issue/DAN-2070/lru-cache-removal
It turns out lru_cache never(?) gets garbage collected. that's awkward.

How Has This Been Tested?

n/a

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

@evan-onyx evan-onyx requested a review from a team as a code owner June 10, 2025 18:11
Copy link

vercel bot commented Jun 10, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 10, 2025 6:40pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Removes lru_cache implementation from Google Drive connector to fix memory leak issues where cached objects were never being garbage collected.

  • Removed backend/onyx/utils/lazy.py which contained problematic lru_cache implementation causing memory leaks
  • Modified backend/onyx/connectors/google_drive/doc_conversion.py to directly initialize services instead of using lazy evaluation
  • Potential performance impact from removing caching, but necessary tradeoff for memory stability
  • Consider monitoring service initialization performance impact

2 files reviewed, 1 comment
Edit PR Review Bot Settings | Greptile

@Weves Weves enabled auto-merge June 10, 2025 18:59
@Weves Weves added this pull request to the merge queue Jun 10, 2025
Merged via the queue into main with commit 83137a1 Jun 10, 2025
11 checks passed
@Weves Weves deleted the bugfix/drive-lru-cache-memory branch June 10, 2025 20:39
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* remove lru cache

* fix types issue

* mypy
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