ufukomer / node-impala

Node Client for Impala using Apache Thrift
https://www.npmjs.com/package/node-impala
MIT License
31 stars 12 forks source link

Fix bug causing EventEmitter memory leak detected warning. #13

Closed ofrebourg closed 7 years ago

ofrebourg commented 7 years ago

The following warning would be caused after issuing 10 queries: (node) warning: possible EventEmitter memory leak detected. 11 a listeners added. Use emitter.setMaxListeners() to increase limit. The fix was to remove the listener for the 'error' event once the data has been successfully received.

ufukomer commented 7 years ago

@ofrebourg thanks! I'll try this very soon.

ofrebourg commented 7 years ago

You're welcome :) I found this issue this morning (here's an interesting link: http://www.jongleberry.com/understanding-possible-eventemitter-leaks.html) and tracked the issue down to node-impala. The file in libs was generated using gulp, as you can guess. I don't know why some unrelated lines in that file have changed, but the functionality is equivalent to the previous version anyway. I've been running this new version for a few hours now and haven't seen any warning. I hope it works well for you too!

ufukomer commented 7 years ago

I'll publish new version of node-impala soon.

ofrebourg commented 7 years ago

Brilliant, thanks!