Skip to content

Commit 854ad75

Browse files
authored
fix(import): Fix memory leak in listCSVFields() COMPASS-6630 (#4178)
1 parent e3a6d4d commit 854ad75

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/compass-import-export/src/import/list-csv-fields.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export async function listCSVFields({
8686

8787
if (lines === NUM_PREVIEW_FIELDS + 1) {
8888
parser.abort();
89+
// Aborting the parser does not destroy the input stream. If we don't
90+
// destroy the input stream it will try and read the entire file into
91+
// memory.
92+
input.destroy();
8993
}
9094
},
9195
complete: function () {

0 commit comments

Comments
 (0)