question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Worker did not remove the event listener when it ended.

See original GitHub issue

Hi, I’ve found the following warning message.

(node:80974) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 21 end listeners added to [Redis]. 
Use emitter.setMaxListeners() to increase limit

And then investigated it. As a result, First, the multi-worker had been running one or two if the queue is empty. Second, Each worker added the event listener into the Redis when the worker started. Finally, any worker did not remove the event listener when it ended.

As the time goes the event listener adds infinitely. I think when the worker ends - in the end method of the worker, it should remove the event listener in the Redis.

Please let me know your opinion. Thanks.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
evantahlercommented, May 24, 2022

Amazing - please submit a PR with the fix, and I’ll get a release out quickly!

0reactions
hervalcommented, Sep 6, 2022

I’m not sure I have enough familiarity w/ the codebase to contribute atm 😦

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript removeEventListener not working - Stack Overflow
In a React function component, make sure to define the callback with the useCallback(() => {}) hook. If you fail to do this,...
Read more >
EventTarget.removeEventListener() - Web APIs | MDN
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.
Read more >
Events | Maps JavaScript API - Google Developers
To remove a specific event listener, it must have been assigned to a variable. You can then call removeListener() , passing the variable...
Read more >
Why didn't remove event listener work? - Reddit
When you add an event handler function using addEventListener , you need to pass that exact function to removeEventListener to remove it. In ......
Read more >
Events | Node.js v19.3.0 Documentation
If an EventEmitter does not have at least one listener registered for the 'error' ... The 'removeListener' event is emitted after the listener...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found