-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
fix(core): Reduce memory consumption on BinaryDataManager.init
#6633
Conversation
BinaryDataManager.init
Great PR! Please pay attention to the following items before merging: Files matching
Files matching
Make sure to check off this list before asking for review. |
f642abc
to
751ded4
Compare
const fileNames = await fs.readdir(this.storagePath); | ||
const deletedIds = []; | ||
for (const fileName of fileNames) { | ||
const executionId = fileName.match(executionExtractionRegexp)?.[1]; |
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.
Is it possible that the regexp also matches the .metadata
that is the extension as part of this? If so, it'd cause the deletion below to fail as it'd try to delete something.metadata.metadata
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 regexp has a $
after the uuid matching, so it should not be matching the metadata file names.
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.
LGTM - it looks tome that the main change is simply removing deleteMetaFileByPath
to using glob
to find all files that needed to be removed. Is that right?
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #6633 +/- ##
==========================================
- Coverage 28.93% 28.87% -0.07%
==========================================
Files 3071 3069 -2
Lines 188445 188422 -23
Branches 20893 20893
==========================================
- Hits 54532 54409 -123
- Misses 133033 133131 +98
- Partials 880 882 +2
☔ View full report in Codecov by Sentry. |
|
Passing run #1425 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
|
When there are a few thousand binary data file to delete, the `deleteMarkedFiles` and `deleteMarkedPersistedFiles` methods need a lot of memory to process these files, irrespective of if these files have any data or not.
751ded4
to
35dd6e3
Compare
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.
LGTM
✅ All Cypress E2E specs passed |
fix(core): Reduce memory consumption on BinaryDataManager.init When there are a few thousand binary data file to delete, the `deleteMarkedFiles` and `deleteMarkedPersistedFiles` methods need a lot of memory to process these files, irrespective of if these files have any data or not.
Got released with |
fix(core): Reduce memory consumption on BinaryDataManager.init When there are a few thousand binary data file to delete, the `deleteMarkedFiles` and `deleteMarkedPersistedFiles` methods need a lot of memory to process these files, irrespective of if these files have any data or not.
* master: ci!: Drop support for Node.js 16. Add initial support for Node.js 20 (#6649) feat(API): Implement users account quota guards (#6434) feat(OpenAI Node): Update max token limit to support newer model limits (#6644) ci: Run checklist job as a separate workflow (no-changelog) (#6645) fix(HTTP Request Node): Cleanup circular references in response (#6590) fix(Postgres Node): Upsert does not fetch columns when schema other then public (#6643) fix(core): Update docker compose setup for V1 images (#6642) refactor: Delete unnecessary interface re-exports from core, and delete unused code in nodes-base (no-changelog) (#6631) fix(core): Reduce memory consumption on `BinaryDataManager.init` (#6633) fix(editor): Implement simple view for templates experiment (no-changelog) (#6637) # Conflicts: # packages/editor-ui/src/stores/settings.store.ts
* ADO-814-trial-banner: ✔️ Updated callout component snapshots 👌 Moving DOM logic from the store 👌 Addressing more points from code review 👌 Refactoring trial banner component and ui store 👌 Updating permanent banner dismiss endpoint and back-end logic ⚡ Updating the migrations syntax ci!: Drop support for Node.js 16. Add initial support for Node.js 20 (#6649) feat(API): Implement users account quota guards (#6434) feat(OpenAI Node): Update max token limit to support newer model limits (#6644) ci: Run checklist job as a separate workflow (no-changelog) (#6645) fix(HTTP Request Node): Cleanup circular references in response (#6590) fix(Postgres Node): Upsert does not fetch columns when schema other then public (#6643) fix(core): Update docker compose setup for V1 images (#6642) refactor: Delete unnecessary interface re-exports from core, and delete unused code in nodes-base (no-changelog) (#6631) fix(core): Reduce memory consumption on `BinaryDataManager.init` (#6633) ⚡ Updating upgrade plan button click 👌 Addressing design review feedback ⚡ Using query parameters in migrations fix(editor): Implement simple view for templates experiment (no-changelog) (#6637) ⚡ Updating migration files
When there are a few thousand binary data file to delete, the
deleteMarkedFiles
anddeleteMarkedPersistedFiles
methods need a lot of memory to process these files, irrespective of if these files have any data or not.Fixes https://linear.app/n8n/issue/HELP-219