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

eventemitter2.js throws error after warning #486

Open
pmbert opened this issue May 6, 2019 · 2 comments
Open

eventemitter2.js throws error after warning #486

pmbert opened this issue May 6, 2019 · 2 comments

Comments

@pmbert
Copy link

pmbert commented May 6, 2019

After warning for possible memory leak eventemitter2.js throws an error.
This is fatal, if module stops working for this reason.
Code at that place in eventemitter2.js: console.trace();

Log:

[2019-05-05 18:26:15.999] [I] [core] (node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit. 11
[2019-05-05 18:26:16.006] [E] [core] Callback execution error: TypeError: undefined is not a function
    at EventEmitter.on [as addListener] (automation/lib/eventemitter2.js:392:29)
    at _.extend.on (automation/classes/DevicesCollection.js:200:37)

Z-Way version v2.3.8

@PoltoS
Copy link
Member

PoltoS commented May 6, 2019

Do you have a lot of subscriptions to the same device change?

You can change defaultMaxListeners at the top of automation/lib/eventemitter2.js and see at which number this message disappears. Then it is worth to analyse why do you have so mane subscriptions.

May be it is worth to increase this value by default

@pmbert
Copy link
Author

pmbert commented May 7, 2019

Do you have a lot of subscriptions to the same device change?

As far as I understand this happens, if several instances are waiting for change of the same metric of the same device. Yes I have.

May be it is worth to increase this value by default

The warning is not the problem. Problem is, that eventemitter2 throws an exception after the warning and the module goes wrong.

I already tried to increase the limit with emitter.setMaxListeners() as mentioned in the warning. But with no effect. Either it doesn't work or I haven't understood how to do it right.

Now I removed the lines 'console.trace();' from eventemitter2. Seems that it's not defined.

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