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

MaxListenersExceededWarning #444

Closed
netmiller opened this issue Sep 2, 2021 · 3 comments
Closed

MaxListenersExceededWarning #444

netmiller opened this issue Sep 2, 2021 · 3 comments

Comments

@netmiller
Copy link

I'm getting (occasionally) error/warning message :

08:10:08: (node:187192) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 21 uncaughtException listeners added to [process]. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:390:17)
    at process.addListener (events.js:406:10)
    at Object.xmllint.validateXML (/opt/iris3/server/node_modules/node-xmllint/xmllint.js:12:2315)
    at /opt/iris3/server/node_modules/@authenio/samlify-node-xmllint/index.ts:15:34
    at new Promise (<anonymous>)
    at exports.validate (/opt/iris3/server/node_modules/@authenio/samlify-node-xmllint/index.ts:14:10)
    at Object.<anonymous> (/opt/iris3/server/node_modules/samlify/src/libsaml.ts:636:22)
    at step (/opt/iris3/server/node_modules/samlify/build/src/libsaml.js:38:23)
    at Object.next (/opt/iris3/server/node_modules/samlify/build/src/libsaml.js:19:53)
    at /opt/iris3/server/node_modules/samlify/build/src/libsaml.js:13:71

This is Express-backend serving React client, I think quite normal anyway.
Samlify is updated (yesterday) to [email protected] .
Node app is using typescript, and transpiled with tsc.
Some days ago I tried to increase maxListeners adding : process.setMaxListeners(20) to main.ts. I think default is 10. But this does not help except error message is complaining : 21 uncaughtException....

Any idea what is this and is there anything to change in application.

@tngan
Copy link
Owner

tngan commented Sep 2, 2021

Hi @netmiller, thanks for your report. Let me check the lint library.

@tngan
Copy link
Owner

tngan commented Sep 20, 2021

@netmiller There is one ticket in the repo of lint library. Let's continue the discussion in the following ticket.

authenio/samlify-node-xmllint#4

@tngan tngan closed this as completed Sep 20, 2021
@netmiller
Copy link
Author

This memory leak has fixed now by removing schema-validator @authenio/samlify-validate-with-xmllint.
Now skipping validation totally :

samlify.setSchemaValidator({
    validate: (response: string) => {
        return Promise.resolve('skipped');
    }
});

and app seems to behave much better.
This validator (samlify-validate-with-xmllint) has serious bug, and should avoid, imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants