RocketChat / RocketChat/Rocket.Chat
Possible EventEmitter memory leak detected
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 46.1k
- Forks
- 13.9k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 130
Description
Description:
After some minutes of running logfiles get flooded with:
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
Steps to reproduce:
it always happens after some minutes.
Server Setup Information:
- Version of Rocket.Chat Server: 6.4.8
- Operating System: Debian 12
- Deployment Method: docker
- Number of Running Instances: 4
- DB Replicaset Oplog:
- NodeJS Version: v14.21.3
- MongoDB Version: 5.0.21 / wiredTiger (oplog Aktiviert)
Client Setup Information
- Desktop App or Browser Version: browser / official rocket chat app
- Operating System: Mac OS Sonoma
Relevant logs:
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
(node:9) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 wakeup listeners added to [Connection]. Use emitter.setMaxListeners() to increase limit
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the warning in the Rocket.Chat server using the reported Docker, Node.js, and MongoDB setup, then inspect the EventEmitter Connection and its wakeup listeners. Trace which operation repeatedly adds listeners over time and verify that the warning no longer appears during sustained operation without merely raising the listener limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100