Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

possible event emitter leak #40

Closed devcurmudgeon closed 13 years ago

devcurmudgeon commented 13 years ago

on Mac, Safari - I run the Express chat demo - create two users, send no messages... and wait a few minutes... to see the following warning message

$ node app Express server listening on port 8080 8 Apr 00:08:52 - Your node instance does not have root privileges. This means that the flash XML policy file will be served inline instead of on port 843. This will slow down initial connections slightly. 8 Apr 00:08:52 - socket.io ready - accepting connections 8 Apr 00:08:57 - Initializing client with transport "xhr-polling" 8 Apr 00:08:57 - Client 1566290301270783 connected Joined: undefined 8 Apr 00:09:36 - Initializing client with transport "websocket" 8 Apr 00:09:36 - Client 3758795636240393 connected Joined: user1 8 Apr 00:10:25 - Initializing client with transport "websocket" 8 Apr 00:10:25 - Client 6171762924641371 connected Joined: user2 (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace: at Socket. (events.js:123:17) at [object Object]. (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/client.js:83:20) at [object Object]._onConnect (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/transports/xhr-polling.js:23:35) at [object Object].check (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/listener.js:77:12) at HTTPServer. (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/listener.js:33:14) at HTTPServer.emit (events.js:67:17) at HTTPParser.onIncoming (http.js:1108:12) at HTTPParser.onHeadersComplete (http.js:108:31) at Socket.ondata (http.js:1007:22) at Socket._onReadable (net.js:678:27) (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit. Trace: at Socket. (events.js:123:17) at [object Object]. (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/client.js:70:19) at [object Object]._onConnect (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/transports/xhr-polling.js:23:35) at [object Object].check (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/listener.js:77:12) at HTTPServer. (/usr/local/lib/node/.npm/socket.io/0.6.16/package/lib/socket.io/listener.js:33:14) at HTTPServer.emit (events.js:67:17) at HTTPParser.onIncoming (http.js:1108:12) at HTTPParser.onHeadersComplete (http.js:108:31) at Socket.ondata (http.js:1007:22) at Socket._onReadable (net.js:678:27)

dvv commented 13 years ago

Same on i686 32-bit debian 6.0, chrome/opera/firefox

tglines commented 13 years ago

This is an issue with XHR transports in Socket.IO ... its discussed by guille and others here ... http://groups.google.com/group/socket_io/browse_thread/thread/ffa1ab005c64676e?pli=1

The socket.io guys put in a fix ~12 days ago here: https://github.com/LearnBoost/Socket.IO-node/pull/161

Therefore updating socket.io (npm update socket.io) to at least 0.6.17 should fix this and I had a conversation with Sridatta about updating the Socket.IO dependency.

sridatta commented 13 years ago

I upped the socket.io dependency version to 0.6.17, which has the fix to this. Manually update your socket.io or wait for the next NowJS release which will force an update.

Closing.