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

Raise max listener limit for connections #418

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

deyaaeldeen
Copy link

This warning from NodeJS is emitted when there are more than 10 connections in one session and they're being closed:

(node:7050) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnected listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
(Use node --trace-warnings ... to show where the warning was created)

Although this warning is generally helpful in detecting leaks, the user has already made a conscious decision to connect to that many connections and the warning is not helpful to them in this context. They're already trying to close those connections, and, in that process, we need to install listeners for disconnection events.

To disable this warning, this PR raises the limit on max listeners to 1000 for connections.

@grs
Copy link
Member

grs commented May 7, 2024

Could this not be done by the application itself?

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

Successfully merging this pull request may close these issues.

2 participants