Skip to content
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

EventEmitter memory leak with successful sendfile #1244

Merged
merged 1 commit into from
Jul 24, 2012

Conversation

RubenVerborgh
Copy link
Contributor

If sendfile is successful, the socket error listener doesn't get removed.
This leads to an EventEmitter memory leak (source: StackOverflow):

 (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace: 
    at Socket.<anonymous> (events.js:139:15)
    at ServerResponse.sendfile (/data/www/margintop/server/node_modules/express/lib/response.js:185:14)
    at /data/www/margintop/server/webserver/webserver.js:17:9
    at callbacks (/data/www/margintop/server/node_modules/express/lib/router/index.js:165:11)
    at param (/data/www/margintop/server/node_modules/express/lib/router/index.js:139:11)
    at pass (/data/www/margintop/server/node_modules/express/lib/router/index.js:146:5)
    at Router._dispatch (/data/www/margintop/server/node_modules/express/lib/router/index.js:173:4)
    at Object.router [as handle] (/data/www/margintop/server/node_modules/express/lib/router/index.js:33:10)
    at next (/data/www/margintop/server/node_modules/express/node_modules/connect/lib/proto.js:190:15)
    at multipart (/data/www/margintop/server/node_modules/express/node_modules/connect/lib/middleware/multipart.js:52:61)

tj added a commit that referenced this pull request Jul 24, 2012
EventEmitter memory leak with successful sendfile
@tj tj merged commit cb84413 into expressjs:master Jul 24, 2012
@tj
Copy link
Member

tj commented Jul 24, 2012

thanks! bad regression when switching over to visionmedia/send

rlidwka pushed a commit to rlidwka/express that referenced this pull request Aug 6, 2014
EventEmitter memory leak with successful sendfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants