multer
multer copied to clipboard
fix: MEMORY LEAK
One important caveat was ignored by piping request stream to busboy stream. This commit aknowledges that caveat by closing busboy stream when request stream encounters an error. More information about this caveat can be found on https://nodejs.org/api/stream.html#readablepipedestination-options.
One important caveat is that if the Readable stream emits an error during processing, the Writable destination is not closed automatically. If an error occurs, it will be necessary to manually close each stream in order to prevent memory leaks.
This PR also fixes multiple issues that are caused by this caveat some are listed blow.
- #259
- #256
- #38
- (maybe) #53
- (maybe) #1058
Some PR's (that may introduce breaking changes) are closed by this PR also (without breaking changes) and some are listed blow.
- #1117
- #971
- #438
- #429
PLEASE MERGE THIS BECAUSE IT'S INSANE ANNOYING HAVING TO RELAUNCH THE SERVER EVERY DAY BECAUSE THOUSANDS OF OPEN STREAMS ARE NOT CLOSED (MEMORY LEAKS)
@LinusU here is a not breaking change that will fix all the above.
Sorry for the late reply, this looks good 👍
Only have one question, will the next be called with an error when this happens? Could you add a test case covering this?
Bump
@LinusU Merger?
@LinusU we can gladly help merge and release here - also see #1161
@LinusU Can you please merge this? Servers that use multer are exposed to DOS attacks!
Bump, can we merge this please?