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.

(node) warning: possible EventEmitter memory leak detected. 11 job ttl exceeded ack listeners added

See original GitHub issue
(node) warning: possible EventEmitter memory leak detected. 11 job ttl exceeded ack listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
    at Queue.addListener (events.js:239:17)
    at Queue.on (/mnt/app/node_modules/kue/lib/kue.js:130:13)
    at Command.callback (/mnt/app/node_modules/kue/lib/kue.js:234:16)
    at RedisClient.return_reply (/mnt/app/node_modules/redis/index.js:664:25)
    at HiredisReplyParser.reply_parser.send_reply (/mnt/app/node_modules/redis/index.js:332:14)
    at HiredisReplyParser.execute (/mnt/app/node_modules/redis/lib/parsers/hiredis.js:30:18)
    at Socket.<anonymous> (/mnt/app/node_modules/redis/index.js:131:27)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at Socket.Readable.push (_stream_readable.js:110:10)
    at TCP.onread (net.js:523:20)

Is this warning just related to the number of jobs that have TTL expiring? We can use emitter.setMaxListeners() to increase this value and prevent the warning, but I’m curious about the root cause.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:7
  • Comments:30 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
Davounetcommented, Sep 10, 2017

I’m running into the same warning when the total amount of jobs (their concurrency value actually) exceeds 10. It doesn’t seem to be anything bad, only a warning, but it’s quite annoying seeing this poping up.

4reactions
popey456963commented, Dec 8, 2017

@Shadowys The warning isn’t an issue in this use case. You’re expecting over ten event listeners, so it’s not a memory leak.

You can do some prototype hacks to avoid the error:

// 0 = infinite listeners
require('events').EventEmitter.prototype._maxListeners = 0;
Read more comments on GitHub >

github_iconTop Results From Across the Web

Possible EventEmitter memory leak detected. 11 message lis ...
I know this might flag as a duplicate solution but the solution on stack overflow is not working for me. Problem (node:5716) ...
Read more >
(node) warning: possible EventEmitter memory leak detected. 11 job ...
(node) warning: possible EventEmitter memory leak detected. 11 job ttl exceeded ack listeners added. Use emitter.setMaxListeners() to increase limit.
Read more >
Understanding memory leaks in node.js part 2 - alxolr
(node:10031) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. Eleven event listeners added. Use emitter.
Read more >
OptimalBits/bull - Gitter
its not really a memory leak, just a warning since you have listening more than 11 times to one event. Its just a...
Read more >
Node.js Memory Leak Detection: How to Debug & Avoid Them
The use of setTimeout, setInterval, Observers, and event listeners can cause memory leaks when heavy object references are kept in their ...
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