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 detected when running 'get' #68

Open
matiu opened this issue Apr 18, 2015 · 2 comments
Open

EventEmitter memory leak detected when running 'get' #68

matiu opened this issue Apr 18, 2015 · 2 comments

Comments

@matiu
Copy link

matiu commented Apr 18, 2015

After our client runs for a couple of hours, when calling

db.get(xxx, function(...

we get:

(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
   at Db.EventEmitter.addListener (events.js:160:15)
   at Db.addEventListener.Db.on (/xx/node_modules/multilevel/lib/client.js:110:13)
   at Db.EventEmitter.once (events.js:185:8)
   at Db._queue (/xx/node_modules/multilevel/lib/client.js:209:13)
   at Db.db.(anonymous function) [as get] (/opt/xx/node_modules/multilevel/lib/client.js:173:10)
  [...]
  1. Any idea what could trigger this? This is a normal nodejs server, running with nodejs cluster (nr of instances = 4)
  2. Since this exception happens async, and it is not catch and returned as 'err', it stops the execution. It should be catch and return as err.

thanks a lot.

PS: This is with multilevel running on the same box as the client, and the DB is on a local HDD.

@juliangruber
Copy link
Owner

Can you tell me which event emitters you added on db? Multilevel itself only registers .on('open', fn).

@juliangruber
Copy link
Owner

And you can catch those running db.on('error', function(err){ // your error handler })

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

No branches or pull requests

2 participants