This repository has been archived by the owner. It is now read-only.
Permalink
6 comments
on commit
sign in to comment.
Showing
with
37 additions
and 20 deletions.
- +7 −0 doc/api/http.markdown
- +20 −16 lib/http.js
- +10 −4 test/simple/test-http-response-close.js
This comment has been minimized.
vulkanr repliedJan 23, 2012
i think "assignSocket" is called every time on keep-alive connections. The "close" event listeners will just keep ramping up until hitting the listener limit.
This comment has been minimized.
bnoordhuis repliedJan 23, 2012
Do you have a test case I can try? The logic seems okay to me and I see a removal for every added 'close' listener.
This comment has been minimized.
vulkanr repliedJan 23, 2012
plain vanilla handler:
app.get('/test', function(req,res) {
res.end();
});
curl -v http://localhost:8888/test
Uncaught TypeError: Cannot call method 'emit' of null
at Socket.onServerResponseClose (http.js:780:21)
at Socket.emit (events.js:88:20)
at Array. (net.js:320:10)
at EventEmitter._tickCallback (node.js:192:40)
curl -v http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test http://localhost:8888/test
server warning/exception:
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace:
at Socket. (events.js:139:15)
at ServerResponse.assignSocket (http.js:786:10)
at HTTPParser.onIncoming (http.js:1454:11)
at HTTPParser.onHeadersComplete (http.js:102:31)
at Socket.ondata (http.js:1387:22)
at TCP.onread (net.js:354:27)
This comment has been minimized.
bnoordhuis repliedJan 23, 2012
That's probably a bug in whatever library you're using. Below is a plain Node example that works fine with curl or
ab -k
:This comment has been minimized.
vulkanr repliedJan 23, 2012
you are right. sorry for the trouble. it was an old piece of code which got included in my test. upgrade to 0.6.8 kicked the error in.
This comment has been minimized.
kelnishi repliedFeb 23, 2012
How did you resolve this? I've got the exact same error, but I'm not sure what old code would cause this.
edit: found the cause. It was the long-stack-traces module.