-
Notifications
You must be signed in to change notification settings - Fork 84
[ENG-1985] Do not query for large cols when not needed #6975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6975 +/- ##
=======================================
Coverage 87.31% 87.31%
=======================================
Files 525 525
Lines 34512 34515 +3
Branches 3984 3984
=======================================
+ Hits 30134 30137 +3
Misses 3511 3511
Partials 867 867 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Greptile OverviewGreptile SummaryThis PR introduces a memory optimization to prevent OOM errors when querying multiple privacy requests. A new The optimization is applied in five strategic locations:
All modified queries only need basic request metadata and identity data, making them ideal candidates for deferred loading. Individual privacy request queries (by ID) continue to load all columns normally, ensuring existing functionality for accessing filtered results and URLs remains intact. Confidence Score: 5/5
Important Files ChangedFile Analysis
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
5 files reviewed, no comments
vcruces
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks great!
I tested by creating 4 privacy requests and applied actions like approve, deny, and delete. I also tried the search bar and it worked correctly. Nice work!
Co-authored-by: Jade Wibbels <jade@ethyca.com>
Co-authored-by: Jade Wibbels <jade@ethyca.com>
Ticket ENG-1985
Description Of Changes
🎯 We are seeing some instability with NYT related to OOM errors on the server.
There are some large columns that have caused memory issues before, we are loading these into memory in several places using db.query(PrivacyRequest) even when they aren’t needed for the response/functionality.
ex: line 818
Created a new
classmethod-PrivacyRequest.query_without_large_columnsto re-use places where we want to query for PrivacyRequests without going OOM.Code Changes
query_without_large_columnsclass method toPrivacyRequestSteps to Confirm
Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works