martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

Using irc.disconnect is causing memory leak problems #492

Open paladox opened 7 years ago

paladox commented 7 years ago

Hi when I use irc.disconnect and try to reconnect using ircClient.connect

patch https://gerrit.wikimedia.org/r/#/c/323712/2/src/relay.js

It is causing the bot to quit then rejoin irc with grrrit-wm(number+) though we doint want the number.

it keeps saying this in the log

(node) warning: possible EventEmitter memory leak detected. 11 whois listeners added. Use emitter.setMaxListeners() to increase limit. Trace at Client.addListener (events.js:239:17) at Client.whois (/data/project/lolrrit-wm/lolrrit-wm/node_modules/irc/lib/irc.js:1093:14) at Client. (/data/project/lolrrit-wm/lolrrit-wm/src/relay.js:191:15) at emitMany (events.js:108:13) at Client.emit (events.js:182:7) at Client. (/data/project/lolrrit-wm/lolrrit-wm/node_modules/irc/lib/irc.js:557:22) at emitOne (events.js:77:13) at Client.emit (events.js:169:7) at iterator (/data/project/lolrrit-wm/lolrrit-wm/node_modules/irc/lib/irc.js:846:26) at Array.forEach (native)

here is our full log https://phabricator.wikimedia.org/P4626