-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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: MEMORY LEAK #1120
base: master
Are you sure you want to change the base?
fix: MEMORY LEAK #1120
Conversation
One important caveat was ignored by piping request stream to busboy stream. This commit aknowledges that caveat. More information on: https://nodejs.org/api/stream.html#readablepipedestination-options
As mentioned by @Gerard-Szulc we use `removeListener` in node instead of `removeEventListener`
@@ -42,10 +42,16 @@ function makeMiddleware (setup) { | |||
var pendingWrites = new Counter() | |||
var uploadedFiles = [] | |||
|
|||
function requestError(error) { | |||
if(!busboy) return |
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.
busboy
should always be defined here?
if(!busboy) return |
@@ -42,10 +42,16 @@ function makeMiddleware (setup) { | |||
var pendingWrites = new Counter() | |||
var uploadedFiles = [] | |||
|
|||
function requestError(error) { |
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.
function requestError(error) { | |
function requestError (error) { |
Sorry for the late reply, this looks good 👍 Only have one question, will the |
Bump |
@LinusU Merger? |
@LinusU Can you please merge this? Servers that use |
Bump, can we merge this please? |
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.
This PR also fixes multiple issues that are caused by this caveat some are listed blow.
Some PR's (that may introduce breaking changes) are closed by this PR also (without breaking changes) and some are listed blow.
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.