hunterloftis / jackrabbit

Simple AMQP / RabbitMQ job queues for node based on amqplib
292 stars 65 forks source link

Fix memory leak: delete pending reply callback after reply #99

Open kyh opened 5 years ago

kyh commented 5 years ago

The exchange has a memory leak that's only noticeable in high volume traffic. We append a callback function to pendingReplies but never remove it once it's called.

Here are some screenshots of our worker memory before and after this fix:

Screenshot_2018-03-15_13_22_39_png

After: Screen Shot 2018-04-11 at 3 50 54 PM

matmar10 commented 5 years ago

Awesome, @tehkaiyu - thanks for the contribution! It looks like the build is failing when testing this change; can you investigate? Will gladly merge the PR once we verify it's a non-breaking change.

kyh commented 5 years ago

Yep I'll take a look this weekend

kyh commented 5 years ago

Hmm, tests seem to pass locally, any chance this is an issue with the travis setup? bash

Travis logs seem to indicate that it can't connect to the amqp port: https://travis-ci.org/hunterloftis/jackrabbit/jobs/548540256

Uncaught Error: connect ECONNREFUSED 127.0.0.1:5672