Open
Description
I'm importing data with the following code snippet.
const loadDataQuery = `
LOAD DATA LOCAL INFILE 'stream' INTO TABLE import_table FIELDS TERMINATED BY '|' LINES STARTING BY '0' TERMINATED BY '\n'
`;
const [loadDataResults] = await connection.query({
sql: loadDataQuery,
infileStreamFactory: (path: string) => {
return loadDataStream;
}
});
If the data stream produces data very fast the mysql connection's socket has to buffer all this data. This leads to an out of memory error.
It looks like there is code that tries to handle this condition at
node-mysql2/lib/commands/query.js
Line 136 in dbf4887
pause
events. Backpressure has to be handled by using the return value of writable.write.Metadata
Metadata
Assignees
Labels
No labels