Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

possible EventEmitter memory leak detected @ exchange.publish using callback #135

Open
kornel-kedzierski opened this Issue · 3 comments

3 participants

@kornel-kedzierski

amqp.js:2191
example:

exchange.publish(rk, data, {
            mandatory: true,
            deliveryMode: 2
        }, function (err) {
            cb(err);
        });
@shaharke

This issue seems to be solved on the Master branch.

@lookfirst

I'm using master and it isn't resolved.

2013-02-10T21:33:02+00:00 app[web.1]: (node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
2013-02-10T21:33:02+00:00 app[web.1]: Trace
2013-02-10T21:33:02+00:00 app[web.1]:     at Exchange.EventEmitter.addListener (events.js:175:15)
2013-02-10T21:33:02+00:00 app[web.1]:     at Exchange.EventEmitter.once (events.js:196:8)
2013-02-10T21:33:02+00:00 app[web.1]:     at Exchange.publish (/app/node_modules/amqp/amqp.js:2243:12)
2013-02-10T21:33:02+00:00 app[web.1]:     at exports.sendMessageDestination.exec (/app/lib/service/queue.coffee:101:29)
2013-02-10T21:33:02+00:00 app[web.1]:     at async.some (/app/node_modules/async/lib/async.js:292:13)
2013-02-10T21:33:02+00:00 app[web.1]:     at async.forEach (/app/node_modules/async/lib/async.js:86:13)
2013-02-10T21:33:02+00:00 app[web.1]:     at Array.forEach (native)
2013-02-10T21:33:02+00:00 app[web.1]:     at _forEach (/app/node_modules/async/lib/async.js:26:24)
2013-02-10T21:33:02+00:00 app[web.1]:     at Object.async.forEach (/app/node_modules/async/lib/async.js:85:9)
2013-02-10T21:33:02+00:00 app[web.1]:     at Object.async.some (/app/node_modules/async/lib/async.js:291:15)
@lookfirst

Looking at this code further, I can see now why my code may be triggering this issue. I think there is a race condition where my code is executing .publish() is a very tight loop to publish a mad amount of messages and the task.once('ack') isn't able to fire and then remove the error listener fast enough to not print out the error above.

@lookfirst lookfirst referenced this issue from a commit in lookfirst/node-amqp
@lookfirst lookfirst fix for race condition in issue #135 49f362b
@lookfirst lookfirst referenced this issue from a commit in lookfirst/node-amqp
@lookfirst lookfirst prevent another EventEmitter memory leak in Connection issue #135 pul…
…l request #164
68f8c76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.